From patchwork Tue Dec 8 20:35:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 11959657 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 0BAFCC433FE for ; Tue, 8 Dec 2020 20:37:09 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B455E23AA8 for ; Tue, 8 Dec 2020 20:37:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B455E23AA8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wanadoo.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=xSohJPWPApNeIY5nI3VCn3wq4X3T1R13gVEMn41i1SA=; b=yHC/2A6zicpG35Rdc2HJ9DvPWF qrabZF4czWfM345JmtnGpugcDLvSgy7coGX2M3Eh7Myba+WUk1u8MZcl2TXfJ1rT+SPjWECdpi40v 0C9hfm4dto48riPDdsBeUwABseNGzJ6jd6bx0RX7QDI7ysaO548RxZuR3a/DtDwV8lJCyQPnBFVt+ 6t3Kg1EvjEFWh68e+8MJazf0DM1bvI9RCPeE7qDbNV6eV2nDLM1nPm6TqfzntTZA2l1/Q1EBBTgZZ kIpUUnckNyLBIYyKKdwYxqcwkPuswUCMGZoLsR+g6/itNkkhM+uFFUD/+QVIVCd5R49Q1vijywnG7 06aLsgTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmji1-0004JN-Is; Tue, 08 Dec 2020 20:35:41 +0000 Received: from smtp05.smtpout.orange.fr ([80.12.242.127] helo=smtp.smtpout.orange.fr) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmjhy-0004I3-Tw for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2020 20:35:40 +0000 Received: from localhost.localdomain ([93.22.132.205]) by mwinf5d52 with ME id 1wbU240044S2tpH03wbUSh; Tue, 08 Dec 2020 21:35:32 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 08 Dec 2020 21:35:32 +0100 X-ME-IP: 93.22.132.205 From: Christophe JAILLET To: ulf.hansson@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, peter.ujfalusi@ti.com, dianders@chromium.org, cjb@laptop.org Subject: [PATCH] mmc: mxs-mmc: Fix a resource leak in an error handling path in 'mxs_mmc_probe()' Date: Tue, 8 Dec 2020 21:35:27 +0100 Message-Id: <20201208203527.49262-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201208_153539_185783_E96F3D54 X-CRM114-Status: GOOD ( 21.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If 'mmc_of_parse()' fails, we must undo the previous 'dma_request_chan()' call. Fixes: abd37cccd47f ("mmc: mxs: use mmc_gpio_get_ro for detecting read-only status") Signed-off-by: Christophe JAILLET --- I'm not 100% sure of the Fixes tag, but it seems to be the root cause. The erroneous 'out_clk_disable' has then been kept around in the following commits --- drivers/mmc/host/mxs-mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 56bbc6cd9c84..947581de7860 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -628,7 +628,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) ret = mmc_of_parse(mmc); if (ret) - goto out_clk_disable; + goto out_free_dma; mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;