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.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 07C35C433DF for ; Tue, 23 Jun 2020 20:49:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC0F521548 for ; Tue, 23 Jun 2020 20:49:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592945342; bh=2PrOR4tC0eomMZiJu+WKbx+KfKstrk/lQzhkYjghGxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ppLYM8ecnn30q0XR0ZIrv4AUuPw1Ysonmlb4/+3yU9A84rOM1UuX5WVlkbJRUw1WX AzW0hklthNrd8Q78lbDjjM3aPNyT4mzyspxuk94uB2XaIHgqbbKegWv1b0/CYWhpOr weeQbpIE7w5xQOJBo7Y5c72RVFtQqmjbjyGh6L0s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404139AbgFWUtB (ORCPT ); Tue, 23 Jun 2020 16:49:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:48040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404116AbgFWUsw (ORCPT ); Tue, 23 Jun 2020 16:48:52 -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 F003E2098B; Tue, 23 Jun 2020 20:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592945331; bh=2PrOR4tC0eomMZiJu+WKbx+KfKstrk/lQzhkYjghGxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iIPGo8Qo2ij+z09uq7cLsOBd13MIGC2+Wz6qom/5EBwhV3VBn/Mby3cE7VZdXkoBy joiYbOF9UAf5xRVcy79Sc2BQTfn8qW5BE5TQlzUE6h1G2GaDptpoKl2PaJ57kenpGu 8I2v7FYGGxyLl8odOuPXn3a9jgwoex/CVQsyESvI= 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 128/136] mtd: rawnand: mtk: Fix the probe error path Date: Tue, 23 Jun 2020 21:59:44 +0200 Message-Id: <20200623195310.249981499@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 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 From: Miquel Raynal [ Upstream commit 8a82bbcadec877f5f938c54026278dfc1f05a332 ] 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: Sasha Levin --- drivers/mtd/nand/mtk_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/mtk_nand.c b/drivers/mtd/nand/mtk_nand.c index 27fcce71ad38c..ff314ce104e58 100644 --- a/drivers/mtd/nand/mtk_nand.c +++ b/drivers/mtd/nand/mtk_nand.c @@ -1357,7 +1357,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc, ret = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0); if (ret) { dev_err(dev, "mtd parse partition error\n"); - nand_release(nand); + nand_cleanup(nand); return ret; } -- 2.25.1