summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBrian Norris2015-02-28 11:23:25 +0100
committerRichard Weinberger2015-03-26 12:07:17 +0100
commit8eef7d70f7c6772c3490f410ee2bceab3b543fa1 (patch)
tree6a2c04d20a8e7e5b9bd3a4a8e30a80be31c6b560 /drivers/mtd
parentUBIFS: extend debug/message capabilities (diff)
downloadkernel-qcow2-linux-8eef7d70f7c6772c3490f410ee2bceab3b543fa1.tar.gz
kernel-qcow2-linux-8eef7d70f7c6772c3490f410ee2bceab3b543fa1.tar.xz
kernel-qcow2-linux-8eef7d70f7c6772c3490f410ee2bceab3b543fa1.zip
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/attach.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 9d2e16f3150a..b5e154856994 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -410,7 +410,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;
}
mutex_unlock(&ubi->buf_mutex);