[PATCH 16/62] UBI: account for bitflips in both the VID header and data

Teresa Remmet t.remmet at phytec.de
Mon May 23 01:26:04 PDT 2016


From: Brian Norris <computersforpeace at gmail.com>

We are completely discarding the earlier value of 'bitflips', which
could reflect a bitflip found in ubi_io_read_vid_hdr(). Let's use the
bitwise OR of header and data 'bitflip' statuses instead.

Coverity CID #1226856

Cc: stable <stable at vger.kernel.org>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
Signed-off-by: Richard Weinberger <richard at nod.at>
---
 drivers/mtd/ubi/attach.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index b23fa68..dc14a2b 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -403,7 +403,7 @@ int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb,
 		second_is_newer = !second_is_newer;
 	} else {
 		dbg_bld("PEB %d CRC is OK", pnum);
-		bitflips = !!err;
+		bitflips |= !!err;
 	}
 
 	ubi_free_vid_hdr(ubi, vh);
-- 
1.9.1




More information about the barebox mailing list