Skip to content

Commit 2d21543

Browse files
JiangJiasvinodkoul
authored andcommitted
dmaengine: sh: rcar-dmac: Check for error num after setting mask
Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. Fixes: dc31234 ("dmaengine: rcar-dmac: Widen DMA mask to 40 bits") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20220106030939.2644320-1-jiasheng@iscas.ac.cn Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent aa7accb commit 2d21543

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/dma/sh/rcar-dmac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,9 @@ static int rcar_dmac_probe(struct platform_device *pdev)
18691869
dmac->dev = &pdev->dev;
18701870
platform_set_drvdata(pdev, dmac);
18711871
dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK);
1872-
dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40));
1872+
ret = dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40));
1873+
if (ret)
1874+
return ret;
18731875

18741876
ret = rcar_dmac_parse_of(&pdev->dev, dmac);
18751877
if (ret < 0)

0 commit comments

Comments
 (0)