projects
/
wrapfs-5.3.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b227395
)
mtd: spinand: Fix OOB read
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Thu, 1 Oct 2020 10:20:13 +0000
(12:20 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:51:43 +0000
(11:51 +0100)
commit
868cbe2a6dcee451bd8f87cbbb2a73cf463b57e5
upstream.
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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 0d21c68bfe245f3f0aacecb14697158ddb653eea..671700af918048ad6b04a672edf25336bc22390f 100644
(file)
--- a/
drivers/mtd/nand/spi/core.c
+++ b/
drivers/mtd/nand/spi/core.c
@@
-317,6
+317,10
@@
static int spinand_write_to_cache_op(struct spinand_device *spinand,
buf += ret;
}
+ if (req->ooblen)
+ memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
+ req->ooblen);
+
return 0;
}