提交 073b355b 编写于 作者: M Miquel Raynal 提交者: Xie XiuQi

mtd: spinand: Fix OOB read

stable inclusion
from stable-5.10.4
commit baad618d078c857f99cc286ea249e9629159901f
bugzilla: 46903

--------------------------------

commit 868cbe2a upstream.

So far OOB have never been used in SPI-NAND, add the missing memcpy to
make it work properly.

Fixes: 7529df46 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: stable@vger.kernel.org
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20201001102014.20100-6-miquel.raynal@bootlin.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 f4c3bc8f
...@@ -318,6 +318,10 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand, ...@@ -318,6 +318,10 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand,
buf += ret; buf += ret;
} }
if (req->ooblen)
memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
req->ooblen);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册