• Miquel Raynal's avatar
    mtd: nand: Fix nand_do_read_oob() return value · 87e89ce8
    Miquel Raynal authored
    Starting from commit 041e4575 ("mtd: nand: handle ECC errors in
    OOB"), nand_do_read_oob() (from the NAND core) did return 0 or a
    negative error, and the MTD layer expected it.
    
    However, the trend for the NAND layer is now to return an error or a
    positive number of bitflips. Deciding which status to return to the user
    belongs to the MTD layer.
    
    Commit e47f6858 ("mtd: check for max_bitflips in mtd_read_oob()")
    brought this logic to the mtd_read_oob() function while the return value
    coming from nand_do_read_oob() (called by the ->_read_oob() hook) was
    left unchanged.
    
    Fixes: e47f6858 ("mtd: check for max_bitflips in mtd_read_oob()")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarMiquel Raynal <miquel.raynal@free-electrons.com>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    87e89ce8
nand_base.c 170 KB