Skip to content

Commit 44305eb

Browse files
computersforpeacededekind
authored andcommitted
UBI: fastmap: do not miss bit-flips
The return value from 'ubi_io_read_ec_hdr()' was stored in 'err', not in 'ret'. This fix makes sure Fastmap-enabled UBI does not miss bit-flip while reading EC headers, events and scrubs the affected PEBs. This issue was reported by Coverity Scan. Artem: improved the commit message. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
1 parent e911036 commit 44305eb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/mtd/ubi/fastmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai,
423423
pnum, err);
424424
ret = err > 0 ? UBI_BAD_FASTMAP : err;
425425
goto out;
426-
} else if (ret == UBI_IO_BITFLIPS)
426+
} else if (err == UBI_IO_BITFLIPS)
427427
scrub = 1;
428428

429429
/*

0 commit comments

Comments
 (0)