mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
mtd: rawnand: fsmc: Add missing check after DMA map
commit 6c4dab38431fee3d39a841d66ba6f2890b31b005 upstream.
The DMA map functions can fail and should be tested for errors.
Fixes: 4774fb0a48 ("mtd: nand/fsmc: Add DMA support")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Rule: add
Link: https://lore.kernel.org/stable/20250702065806.20983-2-fourier.thomas%40gmail.com
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d198239d2c
commit
4a389f6dc9
1 changed files with 2 additions and 0 deletions
|
|
@ -492,6 +492,8 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
|
|||
|
||||
dma_dev = chan->device;
|
||||
dma_addr = dma_map_single(dma_dev->dev, buffer, len, direction);
|
||||
if (dma_mapping_error(dma_dev->dev, dma_addr))
|
||||
return -EINVAL;
|
||||
|
||||
if (direction == DMA_TO_DEVICE) {
|
||||
dma_src = dma_addr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue