]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.19.7/ubi-account-for-bitflips-in-both-the-vid-header-and-data.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.19.7 / ubi-account-for-bitflips-in-both-the-vid-header-and-data.patch
1 From 8eef7d70f7c6772c3490f410ee2bceab3b543fa1 Mon Sep 17 00:00:00 2001
2 From: Brian Norris <computersforpeace@gmail.com>
3 Date: Sat, 28 Feb 2015 02:23:25 -0800
4 Subject: UBI: account for bitflips in both the VID header and data
5
6 From: Brian Norris <computersforpeace@gmail.com>
7
8 commit 8eef7d70f7c6772c3490f410ee2bceab3b543fa1 upstream.
9
10 We are completely discarding the earlier value of 'bitflips', which
11 could reflect a bitflip found in ubi_io_read_vid_hdr(). Let's use the
12 bitwise OR of header and data 'bitflip' statuses instead.
13
14 Coverity CID #1226856
15
16 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
17 Signed-off-by: Richard Weinberger <richard@nod.at>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 drivers/mtd/ubi/attach.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- a/drivers/mtd/ubi/attach.c
25 +++ b/drivers/mtd/ubi/attach.c
26 @@ -410,7 +410,7 @@ int ubi_compare_lebs(struct ubi_device *
27 second_is_newer = !second_is_newer;
28 } else {
29 dbg_bld("PEB %d CRC is OK", pnum);
30 - bitflips = !!err;
31 + bitflips |= !!err;
32 }
33 mutex_unlock(&ubi->buf_mutex);
34