summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2017-08-08 22:35:42 +0800
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-08-23 16:49:22 +0200
commitdbf5f6424ed92131b2d5bf363a0176d8a9f531ef (patch)
tree0c6b7f9139b25b7dba3ebcc1a1833de18d884a34 /drivers/mtd
parent892dd1831392adbdf4e55d0c284c3aea6ba4d855 (diff)
downloadlinux-dbf5f6424ed92131b2d5bf363a0176d8a9f531ef.tar.bz2
mtd: nand: sh_flctl: use dma_mapping_error to check map errors
The return value of dma_map_single() should be checked by dma_mapping_error(). However, in function flctl_dma_fifo0_transfer(), its return value is checked against NULL, which could result in failures. Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/sh_flctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index 891ac7b99305..2404d6634bda 100644
--- a/drivers/mtd/nand/sh_flctl.c
+++ b/drivers/mtd/nand/sh_flctl.c
@@ -411,7 +411,7 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
dma_addr = dma_map_single(chan->device->dev, buf, len, dir);
- if (dma_addr)
+ if (!dma_mapping_error(chan->device->dev, dma_addr))
desc = dmaengine_prep_slave_single(chan, dma_addr, len,
tr_dir, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);