提交 4110ab2b 编写于 作者: S Swati Agarwal 提交者: Jialin Zhang

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

stable inclusion
from stable-v5.10.148
commit dae0b77cb8b2d3c61819de7bde620c58cb48f9c2
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0WL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dae0b77cb8b2d3c61819de7bde620c58cb48f9c2

--------------------------------

[ Upstream commit 8f2b6bc7 ]

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: NSwati Agarwal <swati.agarwal@xilinx.com>
Reviewed-by: NRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/20220817061125.4720-4-swati.agarwal@xilinx.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 75301ef9
...@@ -3071,7 +3071,11 @@ static int xilinx_dma_probe(struct platform_device *pdev) ...@@ -3071,7 +3071,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册