From patchwork Mon Apr 7 05:22:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dolev Raviv X-Patchwork-Id: 337370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7D72F14008B for ; Mon, 7 Apr 2014 15:22:52 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WX20w-0006Uz-Ew; Mon, 07 Apr 2014 05:22:34 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WX20p-0004aZ-Ig; Mon, 07 Apr 2014 05:22:27 +0000 Received: from smtp.codeaurora.org ([198.145.11.231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WX20n-0004YE-M3 for linux-mtd@lists.infradead.org; Mon, 07 Apr 2014 05:22:26 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id C1FCC13EFBA; Mon, 7 Apr 2014 05:22:08 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id B65EC13EFFC; Mon, 7 Apr 2014 05:22:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-caf-smtp.dmz.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_SINGLE autolearn=no version=3.3.1 Received: from DRAVIV (unknown [185.23.60.4]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: draviv@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3D3F513EFBA; Mon, 7 Apr 2014 05:22:07 +0000 (UTC) From: "Dolev Raviv" To: "'Tanya Brokhman'" , References: <1396339273-15904-1-git-send-email-tlinder@codeaurora.org> In-Reply-To: <1396339273-15904-1-git-send-email-tlinder@codeaurora.org> Subject: RE: [RFC/PATCH] mtd: ubi: Test return value of __wl_get_peb Date: Mon, 7 Apr 2014 08:22:05 +0300 Message-ID: <001901cf5221$52161110$f6423330$@codeaurora.org> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIvHMrUK5vo1vjs3gwR8pOPAffflZpGCQdw Content-Language: en-us X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140407_012225_790461_1FBFCFCF X-CRM114-Status: GOOD ( 11.81 ) X-Spam-Score: -2.2 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-mtd@lists.infradead.org, 'open list' X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Reviewed-by: Dolev Raviv Thanks, Dolev diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 02317c1..457ead3 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -684,6 +684,9 @@ int ubi_wl_get_peb(struct ubi_device *ubi) peb = __wl_get_peb(ubi); spin_unlock(&ubi->wl_lock); + if (peb < 0) + return peb; + err = ubi_self_check_all_ff(ubi, peb, ubi->vid_hdr_aloffset, ubi->peb_size - ubi->vid_hdr_aloffset); if (err) {