浏览代码

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>
Brian Norris 10 年之前
父节点
当前提交
8eef7d70f7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/mtd/ubi/attach.c

+ 1 - 1
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;
 		second_is_newer = !second_is_newer;
 	} else {
 	} else {
 		dbg_bld("PEB %d CRC is OK", pnum);
 		dbg_bld("PEB %d CRC is OK", pnum);
-		bitflips = !!err;
+		bitflips |= !!err;
 	}
 	}
 	mutex_unlock(&ubi->buf_mutex);
 	mutex_unlock(&ubi->buf_mutex);