Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp711923imj; Wed, 13 Feb 2019 16:17:36 -0800 (PST) X-Google-Smtp-Source: AHgI3IaQHRAaEH9I14F7s8Gg09qjoK4WNb0wGdm/ZLF/WPZwW+ZJ3XbOuOtLJgz/EPZGWS/u9IqP X-Received: by 2002:a63:5109:: with SMTP id f9mr887353pgb.450.1550103456020; Wed, 13 Feb 2019 16:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550103456; cv=none; d=google.com; s=arc-20160816; b=m5f/oWP2doJlojzMCT9Zx+d/O4IywwpksW8G4EuRY3S3t05wHL2Por8tO3KvFzG7z4 jCqciEAp8MrDN7eIJ/88BpXU4ZMhS3Ru+3aJIP8uPbVHtqACBKaxtwo83gygRXDAncYn 6e2x53ZP/C+Abrb0BEdqpOktR6OSbYmQDH/t6QW/eubrDf2qPQ5qXUzz5s13qowI5ROT AJJfTIkPIfUHdeJiaPQwfMOCK6czNBCWC1VTqCP00xG8V6B2ZIfHISfOpucUDdNiKovI l4MwD/t37Cwe9O/DJ72aGzWYi6VRprpwsYfvXfSnMK5pQTTEdwcEBWoEfa3K9S08TXuU YK0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s1BeMTdqk4JfNyRZPM9PYQ+YNgsDQB3MaD7ccJiDfM4=; b=Lq3xhwKkxajUSXZRJpeEOJTRFbsmX60Dk1JRHuoCdx6vrbNbJ0iALogubgUmUOHnpE 4C4VEYK3IFYeLUHA7+O6uOsJJ/FESZG1Di92rHI8WQmPLq5VxtUcMto5EJY2X3NX/fhP m4nkvQ4HbOI7vgWJZKTKIXKzRGIpS9qJeRWvm6RlAW/UG4mGcDa+BKQFDVC426xneYAX vWJuaEDJ4fqfNRz9FxIRVtCmOtBFEu6Mm+VBrx7+T5X66pBC7Kjwhky6iT3Ty3zmzfH9 JG3CmAEMJITipO67vk36GlCWWDR6T2cBj25hYcu8ySRrEUA5qRztq+Q3c5liBxHyQ3dO AYNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IlXNmlxS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p65si800489pfp.140.2019.02.13.16.17.20; Wed, 13 Feb 2019 16:17:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IlXNmlxS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394051AbfBMSpG (ORCPT + 99 others); Wed, 13 Feb 2019 13:45:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:43754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394028AbfBMSpE (ORCPT ); Wed, 13 Feb 2019 13:45:04 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5955222D4; Wed, 13 Feb 2019 18:45:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083503; bh=ICKdlv495ptx260aR/8JVAvkdq8KMT3PF6NdpaxpXMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IlXNmlxSNslNc4QfgzAPuUE2c2A/Kd8skI6MFqQ2wClUS9ezUA4TyhL87tFD7Ho82 UEVU3xWpwxVJF4632SfS6st2O2mtI1vjJPl8n3eEVGONtDkmDDdvHQc7IaZlI5qrp6 kIJih7IpVBcYuj6LaQATvorfdfOIaHFmqaNunrRc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Boris Brezillon , Miquel Raynal Subject: [PATCH 4.20 03/50] mtd: spinand: Fix the error/cleanup path in spinand_init() Date: Wed, 13 Feb 2019 19:38:08 +0100 Message-Id: <20190213183656.040600586@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213183655.747168774@linuxfoundation.org> References: <20190213183655.747168774@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Boris Brezillon commit c3c7dbf4887ab3ed9d611cd1f6e16937f8700743 upstream. The manufacturer specific initialization has already been done when block unlocking takes place, and if anything goes wrong during this procedure we should call spinand_manufacturer_cleanup(). Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs") Cc: Signed-off-by: Boris Brezillon Acked-by: Miquel Raynal Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/spi/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1014,11 +1014,11 @@ static int spinand_init(struct spinand_d for (i = 0; i < nand->memorg.ntargets; i++) { ret = spinand_select_target(spinand, i); if (ret) - goto err_free_bufs; + goto err_manuf_cleanup; ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED); if (ret) - goto err_free_bufs; + goto err_manuf_cleanup; } ret = nanddev_init(nand, &spinand_ops, THIS_MODULE);