dmaengine: sh: rcar-dmac: Check for error num after setting mask
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Thu, 6 Jan 2022 03:09:39 +0000 (11:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Feb 2022 10:57:35 +0000 (11:57 +0100)
commitc64e2664e66f74e03ce9645236511c1d61154ed1
tree1e09ac492f92d3818a240bae4213bc6785ab5bd9
parent2170a3d1c2d84ed8bd233fc085b25cced3da843f
dmaengine: sh: rcar-dmac: Check for error num after setting mask

commit 2d21543efe332cd8c8f212fb7d365bc8b0690bfa upstream.

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: dc312349e875 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/sh/rcar-dmac.c