mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure
[ Upstream commit 8f2b6bc79c
]
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@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/20220817061125.4720-4-swati.agarwal@xilinx.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e38f675825
commit
229769759e
1 changed files with 5 additions and 1 deletions
|
@ -3211,7 +3211,11 @@ static int xilinx_dma_probe(struct platform_device *pdev)
|
||||||
xdev->ext_addr = false;
|
xdev->ext_addr = false;
|
||||||
|
|
||||||
/* Set the dma mask bits */
|
/* 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 */
|
/* Initialize the DMA engine */
|
||||||
xdev->common.dev = &pdev->dev;
|
xdev->common.dev = &pdev->dev;
|
||||||
|
|
Loading…
Reference in a new issue