]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mtd: rawnand: sunxi: Fix the size of the last OOB region
authorSamuel Holland <samuel@sholland.org>
Thu, 29 Dec 2022 18:15:24 +0000 (12:15 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:21:50 +0000 (13:21 +0100)
[ Upstream commit 34569d869532b54d6e360d224a0254dcdd6a1785 ]

The previous code assigned to the wrong structure member.

Fixes: c66811e6d350 ("mtd: nand: sunxi: switch to mtd_ooblayout_ops")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-By: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221229181526.53766-6-samuel@sholland.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/raw/sunxi_nand.c

index ea953e31933ebbae9071197caa8af6e4daf1222a..e03dcdd8bd589dc813129127cd57bcf67aad82c4 100644 (file)
@@ -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;
 }