From: Samuel Holland Date: Thu, 29 Dec 2022 18:15:24 +0000 (-0600) Subject: mtd: rawnand: sunxi: Fix the size of the last OOB region X-Git-Tag: v6.6.17~5424^2^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34569d869532b54d6e360d224a0254dcdd6a1785;p=platform%2Fkernel%2Flinux-rpi.git mtd: rawnand: sunxi: Fix the size of the last OOB region The previous code assigned to the wrong structure member. Fixes: c66811e6d350 ("mtd: nand: sunxi: switch to mtd_ooblayout_ops") Signed-off-by: Samuel Holland Acked-By: Dhruva Gole Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20221229181526.53766-6-samuel@sholland.org --- diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c index 1bddeb1..e673ac4 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -1609,7 +1609,7 @@ static int sunxi_nand_ooblayout_free(struct mtd_info *mtd, int section, if (section < ecc->steps) oobregion->length = 4; else - oobregion->offset = mtd->oobsize - oobregion->offset; + oobregion->length = mtd->oobsize - oobregion->offset; return 0; }