From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 515FEC433E1 for ; Mon, 29 Jun 2020 20:19:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29BB52065D for ; Mon, 29 Jun 2020 20:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593461952; bh=hutlfR1xaBFjPKdvQ57mSBsj0oG+6c8GbbJqFgwq59k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QkEMPdbrAgYHn9nq377dyo+PJ0mJtoh7pwpFPzF9cqFwbYhkKQ/qvIQSCsL9D2LMY Wkd5x4rDDQtl29QMxbk/ku2OHJXaTSjbk6zoP8ZXBOnDdGyLgwD+UzE59WxYYKU5bN davgWZpfyG3v4eGIBI0vI5M4wSPjB3l86JHCyCkU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729941AbgF2UTI (ORCPT ); Mon, 29 Jun 2020 16:19:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:37014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732624AbgF2TZl (ORCPT ); Mon, 29 Jun 2020 15:25:41 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8ACF32541C; Mon, 29 Jun 2020 15:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593445369; bh=hutlfR1xaBFjPKdvQ57mSBsj0oG+6c8GbbJqFgwq59k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NDXhQjS9NDIc5JhzOjsy++nmd65L6jNtayTEIc5mYNvZUQYxMrPmoDm42U2SYb5ic OtgXkfpqu27t3cOEU8DsLxT2Yg/4s1ctUxETyFxx0yC3sHApL4DpElLYqmR0FHc6dD njhm2S7IDIYkBPtBrMaTCJCs2TJk9yd95PBanK/E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Miquel Raynal , Sasha Levin Subject: [PATCH 4.9 124/191] mtd: rawnand: socrates: Fix the probe error path Date: Mon, 29 Jun 2020 11:39:00 -0400 Message-Id: <20200629154007.2495120-125-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629154007.2495120-1-sashal@kernel.org> References: <20200629154007.2495120-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.229-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.9.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.9.229-rc1 X-KernelTest-Deadline: 2020-07-01T15:39+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Miquel Raynal [ Upstream commit 9c6c2e5cc77119ce0dacb4f9feedb73ce0354421 ] nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-51-miquel.raynal@bootlin.com Signed-off-by: Sasha Levin --- drivers/mtd/nand/socrates_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c index f633ff1ebc0ab..957d9597c4847 100644 --- a/drivers/mtd/nand/socrates_nand.c +++ b/drivers/mtd/nand/socrates_nand.c @@ -203,7 +203,7 @@ static int socrates_nand_probe(struct platform_device *ofdev) if (!res) return res; - nand_release(nand_chip); + nand_cleanup(nand_chip); out: iounmap(host->io_base); -- 2.25.1