From: Brian Norris Date: Sat, 28 Feb 2015 10:23:25 +0000 (-0800) Subject: UBI: account for bitflips in both the VID header and data X-Git-Tag: v3.18.14~113 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cdf5f4433cfdbf2aaf3dabbeaa392326895149fe;p=profile%2Fwearable%2Fplatform%2Fkernel%2Flinux-3.18-exynos7270.git 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 Signed-off-by: Brian Norris Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index 6f27d9a..21841fe 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);