Skip to content

Commit cdf5f44

Browse files
computersforpeacesashalevin
authored andcommitted
UBI: account for bitflips in both the VID header and data
[ Upstream commit 8eef7d7 ] 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@vger.kernel.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent 1a18b98 commit cdf5f44

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/mtd/ubi/attach.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb,
408408
second_is_newer = !second_is_newer;
409409
} else {
410410
dbg_bld("PEB %d CRC is OK", pnum);
411-
bitflips = !!err;
411+
bitflips |= !!err;
412412
}
413413
mutex_unlock(&ubi->buf_mutex);
414414

0 commit comments

Comments
 (0)