[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220817061125.4720-4-swati.agarwal@xilinx.com>
Date: Wed, 17 Aug 2022 11:41:25 +0530
From: Swati Agarwal <swati.agarwal@...inx.com>
To: <vkoul@...nel.org>, <lars@...afoo.de>, <adrianml@...mnos.upm.es>,
<libaokun1@...wei.com>, <marex@...x.de>
CC: <dmaengine@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <swati.agarwal@...inx.com>,
<harini.katakam@...inx.com>, <radhey.shyam.pandey@...inx.com>,
<michal.simek@...inx.com>, <swati.agarwal@....com>,
<harini.katakam@....com>, <radhey.shyam.pandey@....com>,
<michal.simek@....com>
Subject: [PATCH v2 3/3] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure
The driver does not handle the failure case while calling
dma_set_mask_and_coherent API.
In case of failure, capture the return value of API and then report an
error.
Addresses-coverity: Unchecked return value (CHECKED_RETURN)
Signed-off-by: Swati Agarwal <swati.agarwal@...inx.com>
Reviewed-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 f63ec9d862ff..7ce8bb160a59 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -3211,7 +3211,11 @@ static int xilinx_dma_probe(struct platform_device *pdev)
xdev->ext_addr = false;
/* Set the dma mask bits */
- dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
+ err = dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
+ if (err < 0) {
+ dev_err(xdev->dev, "DMA mask error %d\n", err);
+ goto disable_clks;
+ }
/* Initialize the DMA engine */
xdev->common.dev = &pdev->dev;
--
2.17.1
Powered by blists - more mailing lists