Commit 6c4dab38 authored by Thomas Fourier's avatar Thomas Fourier Committed by Miquel Raynal
Browse files

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



The DMA map functions can fail and should be tested for errors.

Fixes: 4774fb0a ("mtd: nand/fsmc: Add DMA support")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarThomas Fourier <fourier.thomas@gmail.com>
Rule: add
Link: https://lore.kernel.org/stable/20250702065806.20983-2-fourier.thomas%40gmail.com


Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 3b36f86d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;