Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aefe2f55 authored by Swati Agarwal's avatar Swati Agarwal Committed by Greg Kroah-Hartman
Browse files

dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure



[ Upstream commit 8f2b6bc79c32f0fa60df000ae387a790ec80eae9 ]

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: default avatarSwati Agarwal <swati.agarwal@xilinx.com>
Reviewed-by: default avatarRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/20220817061125.4720-4-swati.agarwal@xilinx.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent db702ecd
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2703,7 +2703,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;