diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-06-13 10:27:18 -0400 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-07-11 02:39:53 -0400 |
commit | 28f3d01eca5269b01e33c1bf976d90c33b546ad9 (patch) | |
tree | 6b804c01fba0bff6bb5072e8d1bac21ca27fb06a /drivers/mtd | |
parent | bc265323deace1f1472832a87458688796318c47 (diff) |
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Fixes: 614049a8d904 ("mtd: nand: sunxi: add support for DMA assisted operations")
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/sunxi_nand.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c index ef7f6dfde80b..653cb3a06cbe 100644 --- a/drivers/mtd/nand/sunxi_nand.c +++ b/drivers/mtd/nand/sunxi_nand.c | |||
@@ -390,8 +390,8 @@ static int sunxi_nfc_dma_op_prepare(struct mtd_info *mtd, const void *buf, | |||
390 | return -ENOMEM; | 390 | return -ENOMEM; |
391 | 391 | ||
392 | dmad = dmaengine_prep_slave_sg(nfc->dmac, sg, 1, tdir, DMA_CTRL_ACK); | 392 | dmad = dmaengine_prep_slave_sg(nfc->dmac, sg, 1, tdir, DMA_CTRL_ACK); |
393 | if (IS_ERR(dmad)) { | 393 | if (!dmad) { |
394 | ret = PTR_ERR(dmad); | 394 | ret = -EINVAL; |
395 | goto err_unmap_buf; | 395 | goto err_unmap_buf; |
396 | } | 396 | } |
397 | 397 | ||