提交 89761a8e 编写于 作者: J Jiasheng Jiang 提交者: Zheng Zengkai

dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size

stable inclusion
from stable-v5.10.102
commit 3b6d25d1b6a298b1f7dbbfef98dd2086ec60960f
bugzilla: https://gitee.com/openeuler/kernel/issues/I567K6

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

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

commit da2ad87f upstream.

As the possible failure of the dma_set_max_seg_size(), it should be
better to check the return value of the dma_set_max_seg_size().

Fixes: 97d49c59 ("dmaengine: rcar-dmac: set scatter/gather max segment size")
Reported-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: NJiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20220111011239.452837-1-jiasheng@iscas.ac.cnSigned-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b64da99a
...@@ -1844,7 +1844,10 @@ static int rcar_dmac_probe(struct platform_device *pdev) ...@@ -1844,7 +1844,10 @@ static int rcar_dmac_probe(struct platform_device *pdev)
dmac->dev = &pdev->dev; dmac->dev = &pdev->dev;
platform_set_drvdata(pdev, dmac); platform_set_drvdata(pdev, dmac);
dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK); ret = dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK);
if (ret)
return ret;
ret = dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40)); ret = dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40));
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册