summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorShravya Kumbham <shravya.kumbham@xilinx.com>2020-12-23 16:51:00 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-17 14:05:36 +0100
commite6f247a5f927c1c1f070af15a84d2d65cec56549 (patch)
tree967e9d40e972cf2f93028f9057f121d60f6f6185 /drivers/dma
parentc15556cb344a6e8235393013e60a7e2648ec699e (diff)
downloadlinux-e6f247a5f927c1c1f070af15a84d2d65cec56549.tar.gz
linux-e6f247a5f927c1c1f070af15a84d2d65cec56549.tar.bz2
linux-e6f247a5f927c1c1f070af15a84d2d65cec56549.zip
dmaengine: xilinx_dma: check dma_async_device_register return value
commit 99974aedbd73523969afb09f33c6e3047cd0ddae upstream. dma_async_device_register() can return non-zero error code. Add condition to check the return value of dma_async_device_register function and handle the error path. Addresses-Coverity: Event check_return. Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support") Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com> Link: https://lore.kernel.org/r/1608722462-29519-2-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/xilinx/xilinx_dma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index a6abfe702c5a..73cb2362322f 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -2742,7 +2742,11 @@ static int xilinx_dma_probe(struct platform_device *pdev)
}
/* Register the DMA engine with the core */
- dma_async_device_register(&xdev->common);
+ err = dma_async_device_register(&xdev->common);
+ if (err) {
+ dev_err(xdev->dev, "failed to register the dma device\n");
+ goto error;
+ }
err = of_dma_controller_register(node, of_dma_xilinx_xlate,
xdev);