From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:51260 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752838AbbEDMiH (ORCPT ); Mon, 4 May 2015 08:38:07 -0400 From: Jiri Slaby To: stable@vger.kernel.org Cc: Brian Norris , Richard Weinberger , Jiri Slaby Subject: [patch added to the 3.12 stable tree] UBI: account for bitflips in both the VID header and data Date: Mon, 4 May 2015 14:37:30 +0200 Message-Id: <1430743082-6957-39-git-send-email-jslaby@suse.cz> In-Reply-To: <1430743082-6957-1-git-send-email-jslaby@suse.cz> References: <1430743082-6957-1-git-send-email-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: From: Brian Norris This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit 8eef7d70f7c6772c3490f410ee2bceab3b543fa1 upstream. 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 Signed-off-by: Brian Norris Signed-off-by: Richard Weinberger Signed-off-by: Jiri Slaby --- drivers/mtd/ubi/attach.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index c071d410488f..79d69bd26dd2 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); -- 2.3.5