[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1608228615-7413-2-git-send-email-radhey.shyam.pandey@xilinx.com>
Date: Thu, 17 Dec 2020 23:40:13 +0530
From: Radhey Shyam Pandey <radhey.shyam.pandey@...inx.com>
To: <vkoul@...nel.org>, <dan.j.williams@...el.com>,
<michal.simek@...inx.com>
CC: <dmaengine@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<git@...inx.com>, Shravya Kumbham <shravya.kumbham@...inx.com>,
"Radhey Shyam Pandey" <radhey.shyam.pandey@...inx.com>
Subject: [PATCH 1/3] dmaengine: xilinx_dma: check dma_async_device_register return value
From: Shravya Kumbham <shravya.kumbham@...inx.com>
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.
Signed-off-by: Shravya Kumbham <shravya.kumbham@...inx.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@...inx.com>
---
drivers/dma/xilinx/xilinx_dma.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 993297d585c0..e41435be5b79 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -3133,7 +3133,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);
--
2.7.4
Powered by blists - more mailing lists