Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 835c72e1 authored by Miquel Raynal's avatar Miquel Raynal Committed by Greg Kroah-Hartman
Browse files

mtd: spinand: Fix OOB read



commit 868cbe2a6dcee451bd8f87cbbb2a73cf463b57e5 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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20201001102014.20100-6-miquel.raynal@bootlin.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 72dc14a9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -378,6 +378,10 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand,
		}
	}

	if (req->ooblen)
		memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
		       req->ooblen);

	return 0;
}