From patchwork Fri Jun 19 14:34:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224031 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 38A6CC433E0 for ; Fri, 19 Jun 2020 15:34:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 088B220734 for ; Fri, 19 Jun 2020 15:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580885; bh=8suDrORI8J9gLI9SPd4KuWsQj2lnHj8vnNhBrFPsNgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rv5o/ox+1VGevkkjKjputn6IQZEDArcGJUOq1/9gptRXMPJrSN0hflBr9aMXT73q7 BQ6O4rTynwffwtXI3xQoR5ibPqfNErqAqmvp/pdXTaSF2seMkc6dX9azpMjZGA4Rl8 Fmd7XHqfoAWirIVg2Th2BXPCFSYL4yYUUhkRjZwA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404690AbgFSPc0 (ORCPT ); Fri, 19 Jun 2020 11:32:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:36318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404604AbgFSPcX (ORCPT ); Fri, 19 Jun 2020 11:32:23 -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 C98B620786; Fri, 19 Jun 2020 15:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580742; bh=8suDrORI8J9gLI9SPd4KuWsQj2lnHj8vnNhBrFPsNgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5yjreBywA+ZyMiOT19sycxHZrhOZvFX1MofSEc0f/Uv5pOViLFwu4Bw/Qq3wbNRq dfy7YYXZdpxCLxO/sIWnM/bILLVwZReJWFedaI/Yp4QL5fT/YZps6AsLjb67mQnmY0 KFiGMZiEDoyq8PDFpdZfCtoFaVTiYvtoWHBzP9OE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal Subject: [PATCH 5.7 365/376] mtd: rawnand: mtk: Fix the probe error path Date: Fri, 19 Jun 2020 16:34:43 +0200 Message-Id: <20200619141727.592220676@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@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 commit 8a82bbcadec877f5f938c54026278dfc1f05a332 upstream. 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 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-28-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/mtk_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/mtk_nand.c +++ b/drivers/mtd/nand/raw/mtk_nand.c @@ -1419,7 +1419,7 @@ static int mtk_nfc_nand_chip_init(struct ret = mtd_device_register(mtd, NULL, 0); if (ret) { dev_err(dev, "mtd parse partition error\n"); - nand_release(nand); + nand_cleanup(nand); return ret; }