Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510AbbB1K2r (ORCPT ); Sat, 28 Feb 2015 05:28:47 -0500 Received: from mail-pd0-f182.google.com ([209.85.192.182]:45903 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728AbbB1K2n (ORCPT ); Sat, 28 Feb 2015 05:28:43 -0500 From: Brian Norris To: Richard Weinberger , Artem Bityutskiy Cc: Brian Norris , , , kernel-janitors@vger.kernel.org Subject: [PATCH 1/5] UBI: account for bitflips in both the VID header and data Date: Sat, 28 Feb 2015 02:23:25 -0800 Message-Id: <1425119009-28634-2-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1425119009-28634-1-git-send-email-computersforpeace@gmail.com> References: <1425119009-28634-1-git-send-email-computersforpeace@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1053 Lines: 32 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 --- 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 9d2e16f3150a..b5e154856994 100644 --- a/drivers/mtd/ubi/attach.c +++ b/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; } else { dbg_bld("PEB %d CRC is OK", pnum); - bitflips = !!err; + bitflips |= !!err; } mutex_unlock(&ubi->buf_mutex); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/