Skip to content

Commit 868cbe2

Browse files
committed
mtd: spinand: Fix OOB read
So far OOB have never been used in SPI-NAND, add the missing memcpy to make it work properly. Fixes: 7529df4 ("mtd: nand: Add core infrastructure to support SPI NANDs") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20201001102014.20100-6-miquel.raynal@bootlin.com
1 parent 00c15b7 commit 868cbe2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/mtd/nand/spi/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ static int spinand_read_from_cache_op(struct spinand_device *spinand,
382382
memcpy(req->databuf.in, spinand->databuf + req->dataoffs,
383383
req->datalen);
384384

385+
if (req->ooblen)
386+
memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
387+
req->ooblen);
388+
385389
return 0;
386390
}
387391

0 commit comments

Comments
 (0)