Commit 28f3d01e authored by Wei Yongjun's avatar Wei Yongjun Committed by Boris Brezillon

mtd: nand: sunxi: fix return value check in sunxi_nfc_dma_op_prepare()

In case of error, the function dmaengine_prep_slave_sg() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fixes: 614049a8 ("mtd: nand: sunxi: add support for DMA assisted operations")
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent bc265323
...@@ -390,8 +390,8 @@ static int sunxi_nfc_dma_op_prepare(struct mtd_info *mtd, const void *buf, ...@@ -390,8 +390,8 @@ static int sunxi_nfc_dma_op_prepare(struct mtd_info *mtd, const void *buf,
return -ENOMEM; return -ENOMEM;
dmad = dmaengine_prep_slave_sg(nfc->dmac, sg, 1, tdir, DMA_CTRL_ACK); dmad = dmaengine_prep_slave_sg(nfc->dmac, sg, 1, tdir, DMA_CTRL_ACK);
if (IS_ERR(dmad)) { if (!dmad) {
ret = PTR_ERR(dmad); ret = -EINVAL;
goto err_unmap_buf; goto err_unmap_buf;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment