aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorShravya Kumbham <shravya.kumbham@xilinx.com>2022-05-10 12:42:41 +0530
committerVinod Koul <vkoul@kernel.org>2022-05-16 18:21:47 +0530
commit9126518e0439bc4b47b15d0da42f0cdba7a74b3a (patch)
tree34d601bd9c6a3c4d4f9367af900ce4cb11ec6e27 /drivers/dma
parentdmaengine: zynqmp_dma: In struct zynqmp_dma_chan fix desc_size data type (diff)
downloadlinux-dev-9126518e0439bc4b47b15d0da42f0cdba7a74b3a.tar.xz
linux-dev-9126518e0439bc4b47b15d0da42f0cdba7a74b3a.zip
dmaengine: zynqmp_dma: check dma_async_device_register return value
Add condition to check the return value of dma_async_device_register and implement its error handling. Addresses-Coverity: Event check_return. Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com> Signed-off-by: Harini Katakam <harini.katakam@xilinx.com> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com> Link: https://lore.kernel.org/r/1652166762-18317-3-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/xilinx/zynqmp_dma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 3ffa7f37c701..915dbe6275d4 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -1094,7 +1094,11 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
p->dst_addr_widths = BIT(zdev->chan->bus_width / 8);
p->src_addr_widths = BIT(zdev->chan->bus_width / 8);
- dma_async_device_register(&zdev->common);
+ ret = dma_async_device_register(&zdev->common);
+ if (ret) {
+ dev_err(zdev->dev, "failed to register the dma device\n");
+ goto free_chan_resources;
+ }
ret = of_dma_controller_register(pdev->dev.of_node,
of_zynqmp_dma_xlate, zdev);