summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-02-28 13:23:25 +0300
committerSasha Levin <sasha.levin@oracle.com>2015-05-18 02:12:10 +0300
commitcdf5f4433cfdbf2aaf3dabbeaa392326895149fe (patch)
tree7caf4bda371444dbbab1cce62cb7d8bbcf2e827c /drivers/mtd
parent1a18b9807e50c4e244df9209b3053ac740a6551d (diff)
downloadlinux-cdf5f4433cfdbf2aaf3dabbeaa392326895149fe.tar.xz
UBI: account for bitflips in both the VID header and data
[ Upstream commit 8eef7d70f7c6772c3490f410ee2bceab3b543fa1 ] 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>
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 6f27d9a1be3b..21841fe25ad3 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -408,7 +408,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);