projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
00c15b7
)
mtd: spinand: Fix OOB read
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Thu, 1 Oct 2020 10:20:13 +0000
(12:20 +0200)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Thu, 10 Dec 2020 21:37:31 +0000
(22:37 +0100)
So far OOB have never been used in SPI-NAND, add the missing memcpy to
make it work properly.
Fixes: 7529df465248 ("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
drivers/mtd/nand/spi/core.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/spi/core.c
b/drivers/mtd/nand/spi/core.c
index 4a4c86d8eeb6a2c7ad4358ab0afa6adbf530d341..bec8c2a57f24f2d89032d3cee7c427252883b08c 100644
(file)
--- a/
drivers/mtd/nand/spi/core.c
+++ b/
drivers/mtd/nand/spi/core.c
@@
-382,6
+382,10
@@
static int spinand_read_from_cache_op(struct spinand_device *spinand,
memcpy(req->databuf.in, spinand->databuf + req->dataoffs,
req->datalen);
+ if (req->ooblen)
+ memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
+ req->ooblen);
+
return 0;
}