Skip to content

Commit 8eef7d7

Browse files
UBI: account for bitflips in both the VID header and data
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>
1 parent 235c362 commit 8eef7d7

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
@@ -410,7 +410,7 @@ int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb,
410410
second_is_newer = !second_is_newer;
411411
} else {
412412
dbg_bld("PEB %d CRC is OK", pnum);
413-
bitflips = !!err;
413+
bitflips |= !!err;
414414
}
415415
mutex_unlock(&ubi->buf_mutex);
416416

0 commit comments

Comments
 (0)