Commit e90b81e8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull dmaengine fixes from Vinod Koul:
 "A bunch of driver fixes for:

   - dma mask fix for mmp pdma driver

   - Xilinx regmap max register, uninitialized addr_width fix

   - device leak fix for bunch of drivers in the subsystem

   - stm32 dmamux, TI crossbar driver fixes for device & of node leak
     and route allocation cleanup

   - Tegra use afer free fix

   - Memory leak fix in Qualcomm gpi and omap-dma driver

   - compatible fix for apple driver"

* tag 'dmaengine-fix-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (25 commits)
  dmaengine: apple-admac: Add "apple,t8103-admac" compatible
  dmaengine: omap-dma: fix dma_pool resource leak in error paths
  dmaengine: qcom: gpi: Fix memory leak in gpi_peripheral_config()
  dmaengine: sh: rz-dmac: Fix rz_dmac_terminate_all()
  dmaengine: xilinx_dma: Fix uninitialized addr_width when "xlnx,addrwidth" property is missing
  dmaengine: tegra-adma: Fix use-after-free
  dmaengine: fsl-edma: Fix clk leak on alloc_chan_resources failure
  dmaengine: mmp_pdma: Fix race condition in mmp_pdma_residue()
  dmaengine: ti: k3-udma: fix device leak on udma lookup
  dmaengine: ti: dma-crossbar: clean up dra7x route allocation error paths
  dmaengine: ti: dma-crossbar: fix device leak on am335x route allocation
  dmaengine: ti: dma-crossbar: fix device leak on dra7x route allocation
  dmaengine: stm32: dmamux: clean up route allocation error labels
  dmaengine: stm32: dmamux: fix OF node leak on route allocation failure
  dmaengine: stm32: dmamux: fix device leak on route allocation
  dmaengine: sh: rz-dmac: fix device leak on probe failure
  dmaengine: lpc32xx-dmamux: fix device leak on route allocation
  dmaengine: lpc18xx-dmamux: fix device leak on route allocation
  dmaengine: idxd: fix device leaks on compat bind and unbind
  dmaengine: dw: dmamux: fix OF node leak on route allocation failure
  ...
parents 3271b25e 76cba1e6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -936,6 +936,7 @@ static void admac_remove(struct platform_device *pdev)
}

static const struct of_device_id admac_of_match[] = {
	{ .compatible = "apple,t8103-admac", },
	{ .compatible = "apple,admac", },
	{ }
};
+7 −2
Original line number Diff line number Diff line
@@ -1765,6 +1765,7 @@ static int atc_alloc_chan_resources(struct dma_chan *chan)
static void atc_free_chan_resources(struct dma_chan *chan)
{
	struct at_dma_chan	*atchan = to_at_dma_chan(chan);
	struct at_dma_slave	*atslave;

	BUG_ON(atc_chan_is_enabled(atchan));

@@ -1774,8 +1775,12 @@ static void atc_free_chan_resources(struct dma_chan *chan)
	/*
	 * Free atslave allocated in at_dma_xlate()
	 */
	kfree(chan->private);
	atslave = chan->private;
	if (atslave) {
		put_device(atslave->dma_dev);
		kfree(atslave);
		chan->private = NULL;
	}

	dev_vdbg(chan2dev(chan), "free_chan_resources: done\n");
}
+5 −1
Original line number Diff line number Diff line
@@ -1699,7 +1699,7 @@ static int sba_probe(struct platform_device *pdev)
	/* Prealloc channel resource */
	ret = sba_prealloc_channel_resources(sba);
	if (ret)
		goto fail_free_mchan;
		goto fail_put_mbox;

	/* Check availability of debugfs */
	if (!debugfs_initialized())
@@ -1729,6 +1729,8 @@ static int sba_probe(struct platform_device *pdev)
fail_free_resources:
	debugfs_remove_recursive(sba->root);
	sba_freeup_channel_resources(sba);
fail_put_mbox:
	put_device(sba->mbox_dev);
fail_free_mchan:
	mbox_free_channel(sba->mchan);
	return ret;
@@ -1744,6 +1746,8 @@ static void sba_remove(struct platform_device *pdev)

	sba_freeup_channel_resources(sba);

	put_device(sba->mbox_dev);

	mbox_free_channel(sba->mchan);
}

+10 −7
Original line number Diff line number Diff line
@@ -102,11 +102,11 @@ static void *cv1800_dmamux_route_allocate(struct of_phandle_args *dma_spec,
	struct llist_node *node;
	unsigned long flags;
	unsigned int chid, devid, cpuid;
	int ret;
	int ret = -EINVAL;

	if (dma_spec->args_count != DMAMUX_NCELLS) {
		dev_err(&pdev->dev, "invalid number of dma mux args\n");
		return ERR_PTR(-EINVAL);
		goto err_put_pdev;
	}

	devid = dma_spec->args[0];
@@ -115,18 +115,18 @@ static void *cv1800_dmamux_route_allocate(struct of_phandle_args *dma_spec,

	if (devid > MAX_DMA_MAPPING_ID) {
		dev_err(&pdev->dev, "invalid device id: %u\n", devid);
		return ERR_PTR(-EINVAL);
		goto err_put_pdev;
	}

	if (cpuid > MAX_DMA_CPU_ID) {
		dev_err(&pdev->dev, "invalid cpu id: %u\n", cpuid);
		return ERR_PTR(-EINVAL);
		goto err_put_pdev;
	}

	dma_spec->np = of_parse_phandle(ofdma->of_node, "dma-masters", 0);
	if (!dma_spec->np) {
		dev_err(&pdev->dev, "can't get dma master\n");
		return ERR_PTR(-EINVAL);
		goto err_put_pdev;
	}

	spin_lock_irqsave(&dmamux->lock, flags);
@@ -136,8 +136,6 @@ static void *cv1800_dmamux_route_allocate(struct of_phandle_args *dma_spec,
			if (map->peripheral == devid && map->cpu == cpuid)
				goto found;
		}

		ret = -EINVAL;
		goto failed;
	} else {
		node = llist_del_first(&dmamux->free_maps);
@@ -171,12 +169,17 @@ static void *cv1800_dmamux_route_allocate(struct of_phandle_args *dma_spec,
	dev_dbg(&pdev->dev, "register channel %u for req %u (cpu %u)\n",
		chid, devid, cpuid);

	put_device(&pdev->dev);

	return map;

failed:
	spin_unlock_irqrestore(&dmamux->lock, flags);
	of_node_put(dma_spec->np);
	dev_err(&pdev->dev, "errno %d\n", ret);
err_put_pdev:
	put_device(&pdev->dev);

	return ERR_PTR(ret);
}

+3 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,

	if (test_and_set_bit(map->req_idx, dmamux->used_chans)) {
		ret = -EBUSY;
		goto free_map;
		goto put_dma_spec_np;
	}

	mask = BIT(map->req_idx);
@@ -103,6 +103,8 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,

clear_bitmap:
	clear_bit(map->req_idx, dmamux->used_chans);
put_dma_spec_np:
	of_node_put(dma_spec->np);
free_map:
	kfree(map);
put_device:
Loading