mtd: rawnand: fsmc: Add missing check after DMA map

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>
This commit is contained in:
Thomas Fourier 2025-07-07 09:39:37 +02:00 committed by Miquel Raynal
parent 3b36f86dc4
commit 6c4dab3843

View File

@ -503,6 +503,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;