Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E60E5C433EF for ; Tue, 28 Sep 2021 16:48:35 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC0F961262 for ; Tue, 28 Sep 2021 16:48:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DC0F961262 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 93EB680C58; Tue, 28 Sep 2021 18:48:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="PeTdiQxa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 30A6E8312A; Tue, 28 Sep 2021 18:48:28 +0200 (CEST) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BF3D280397 for ; Tue, 28 Sep 2021 18:48:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=p.yadav@ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 18SGmECP048573; Tue, 28 Sep 2021 11:48:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1632847694; bh=ElHACRZpoqJEshOszYqjwQHiEOkcjNo04FjOjmYiuuU=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=PeTdiQxahrpm+gnojI3MHXMnyQFfUGiiROBPT/u74NDYCBki1+cEmEpCe+1a8Wmu2 V7xjeHnpiUHUUgWbWjxJPV0u3r1iMKeS6AgRQkXuVRDQ/k3WTjWq2zZ06maSdzFW2y akwoNTTDnlg6q7VgnVciVqRQ65GW9LBTavWr9vJc= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 18SGmEo0061219 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 28 Sep 2021 11:48:14 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 28 Sep 2021 11:48:14 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Tue, 28 Sep 2021 11:48:14 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 18SGmDJf109582; Tue, 28 Sep 2021 11:48:13 -0500 Date: Tue, 28 Sep 2021 22:18:12 +0530 From: Pratyush Yadav To: Marek =?iso-8859-1?Q?Beh=FAn?= CC: Jagan Teki , Tom Rini , , Patrick Delaunay , Pali =?iso-8859-1?Q?Roh=E1r?= , Patrice Chotard , Marek Vasut , Marek =?iso-8859-1?Q?Beh=FAn?= , Simon Glass , Masami Hiramatsu Subject: Re: [PATCH u-boot-spi v2 2/9] mtd: spi-nor-core: Check return value of write_enable() in spi_nor_erase() Message-ID: <20210928164810.3veykwobl3rj2lql@ti.com> References: <20210925173318.25804-1-kabel@kernel.org> <20210925173318.25804-3-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210925173318.25804-3-kabel@kernel.org> User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 25/09/21 07:33PM, Marek Behún wrote: > From: Marek Behún > > The spi_nor_erase() function does not check return value of the > write_enable() call. Fix this. This is the case for many more calls for write_enable(), but we can fix them later I suppose. Reviewed-by: Pratyush Yadav > > Signed-off-by: Marek Behún > Reviewed-by: Simon Glass > Reviewed-by: Jagan Teki > Tested-by: Masami Hiramatsu > --- > drivers/mtd/spi/spi-nor-core.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c > index 529e7e9178..d2018ab702 100644 > --- a/drivers/mtd/spi/spi-nor-core.c > +++ b/drivers/mtd/spi/spi-nor-core.c > @@ -929,7 +929,9 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) > if (ret < 0) > goto erase_err; > #endif > - write_enable(nor); > + ret = write_enable(nor); > + if (ret < 0) > + goto erase_err; > > ret = spi_nor_erase_sector(nor, addr); > if (ret < 0) > -- > 2.32.0 > -- Regards, Pratyush Yadav Texas Instruments Inc.