Skip to content

Commit 8f2b6bc

Browse files
Swati Agarwalvinodkoul
authored andcommitted
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 <[email protected]> Reviewed-by: Radhey Shyam Pandey <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 462bce7 commit 8f2b6bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/dma/xilinx/xilinx_dma.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3091,7 +3091,11 @@ static int xilinx_dma_probe(struct platform_device *pdev)
30913091
xdev->ext_addr = false;
30923092

30933093
/* Set the dma mask bits */
3094-
dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
3094+
err = dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
3095+
if (err < 0) {
3096+
dev_err(xdev->dev, "DMA mask error %d\n", err);
3097+
goto disable_clks;
3098+
}
30953099

30963100
/* Initialize the DMA engine */
30973101
xdev->common.dev = &pdev->dev;

0 commit comments

Comments
 (0)