From patchwork Tue Jun 23 19:59:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 223367 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.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 65D1BC433E0 for ; Tue, 23 Jun 2020 20:50:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C10720767 for ; Tue, 23 Jun 2020 20:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592945445; bh=UEJvs1cLruhzQaC1R2JJ/mebARuLg6W56m+2KUqd530=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zGbd5TijdeyVXWkZJPm/VxBEtJFiZKVYhUrfcS4GD0Cy0+0476H9+70U4TeMHFzD1 qykuSlYtD6znbJ/eMAApkVm7j1EzEs0ZCXFhfGyYdWIVEOmIk6A6g0uLfL2/eK3WAJ Cy+7MgXSCX3yD4lqLYl08wUxIX9gxYVG1LvOLMD4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403917AbgFWUsp (ORCPT ); Tue, 23 Jun 2020 16:48:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:47858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392185AbgFWUsn (ORCPT ); Tue, 23 Jun 2020 16:48:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 7C7312098B; Tue, 23 Jun 2020 20:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592945324; bh=UEJvs1cLruhzQaC1R2JJ/mebARuLg6W56m+2KUqd530=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I7zn8UtV4C1JQIGS83evkpocez4vKCA3U9RjKXrplUPqQ54pi367/s2ib6lEzw5B0 zIPXH4cjTqIDQ8f4g3SEOgHVtrhNoK7odsWLUc2Z8eoOPgFm3mwGIE+wrt0GzO4ObF o+YMxUH099K+4hxyUC3KzaIugg/UpmIvoXaPQGRY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Sasha Levin Subject: [PATCH 4.14 126/136] mtd: rawnand: socrates: Fix the probe error path Date: Tue, 23 Jun 2020 21:59:42 +0200 Message-Id: <20200623195310.142124689@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195303.601828702@linuxfoundation.org> References: <20200623195303.601828702@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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 f960f18ea3e24..8d4f0cd7197d3 100644 --- a/drivers/mtd/nand/socrates_nand.c +++ b/drivers/mtd/nand/socrates_nand.c @@ -195,7 +195,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);