Revert "mtd: spinand: Fix OOB read"

This reverts stable commit baad618d07.

This commit is adding lines to spinand_write_to_cache_op, wheras the upstream
commit 868cbe2a6dcee451bd8f87cbbb2a73cf463b57e5 that this was supposed to
backport was touching spinand_read_from_cache_op.
It causes a crash on writing OOB data by attempting to write to read-only
kernel memory.

Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Felix Fietkau 2021-01-05 11:18:21 +01:00 committed by Greg Kroah-Hartman
parent da5b4cf021
commit 4d3ba541be
1 changed files with 0 additions and 4 deletions

View File

@ -317,10 +317,6 @@ 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;
}