From patchwork Mon Oct 24 11:30:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419354wru; Mon, 24 Oct 2022 05:16:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4DSNvVbfN2By4dmd5b7G2Bs9v3zTxfffNi90lCp+qg6cxb20kxZPovT9mKzKCuoMqfJQC6 X-Received: by 2002:a05:6402:5ca:b0:43b:6e01:482c with SMTP id n10-20020a05640205ca00b0043b6e01482cmr31125144edx.189.1666613769011; Mon, 24 Oct 2022 05:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613769; cv=none; d=google.com; s=arc-20160816; b=zFT1aHksvoiIDbjQgKE2Zae0t5cpPNw6qYsNrp1ATR/zhaqOUivDQSTECCg8I+dTlj 9ORYEaPV3v3mEUwWmwLmL7d8ktgM9caA/DaYw6Omr2TL0pWsM+I3ndn3HvQDhuDdc7dt oEb1hGIPNCI5H0t4Xtin06RQlecfHXYZbzLt2Qv04mvaO6mIiTBV8+AWMAH3h8IeI5hW JB5yZz3NAtzHF3p6mUUXEr3UmZs6sduPE44j8h86T98UwmXID7Rkult22+zB03cOHzzW tpLDE6A2nAuM/qD9X0bHs0+uzC37CZxUj4EwpPBuAreG9oqDgYEutliojTkf0Ehu+gUY vHlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dls44MZfRKxjDpYHgNqgY3mFJmiobBxL0npDJkJwk9w=; b=F761XzZwTeLOPxZQ7ACQE/6C4DygLVbp1BzOV0dn3O/ymqC2jgarfY8gaWN5EEoH77 +LFksm55RgjwE3+hXC9HpGCojyJmWMKHPRVpOiwQ7aKNFTQbLJhy8vHokqoZ4lTTFtve ZVXAVt5HCEwfyG+r8eqHL5sB//AXWyBFicaxPGgQAFElTd+EpzpimUClFVOvY3IOvZaj kgcQ/trjiKfvf9ukzkDYibq5L4IwrqH4RLCFtNYACScVuO0FCmMpOV8INl9vQfOuCGR2 shouPIrCobEwr3Sx/5m5OOS2VZKttYHDLr4hUL2af2EhEsqc47/10XrY0HRdnxDpiUNy J/tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zf3G9eab; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz36-20020a1709077da400b0078d930212c0si28086321ejc.347.2022.10.24.05.15.44; Mon, 24 Oct 2022 05:16:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zf3G9eab; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232513AbiJXMHb (ORCPT + 99 others); Mon, 24 Oct 2022 08:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232982AbiJXMEr (ORCPT ); Mon, 24 Oct 2022 08:04:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA66C54675; Mon, 24 Oct 2022 04:51:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7BFEF612BB; Mon, 24 Oct 2022 11:50:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CC17C433D7; Mon, 24 Oct 2022 11:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612257; bh=0uWZkCQZvSSzBLwJUw8HecZ+r/KnHBzmlr7A/oiemN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zf3G9eab/UXptXFoCPkHVpM/9IDKGQrv8I9iURnvW1nJEFzqaWMKNi6QbTYSs/Nhu aSD+189v9QIh2D8WNbq9gtEXaosm6VYlQFHaX2GxZIoK9WX8yvkIHL90LCIUNKzqNC qiO/FdwQvB+cLT6/qouqLvpLxWSZLOA4RX9cdACY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Ulf Hansson , Sasha Levin Subject: [PATCH 4.14 102/210] mmc: au1xmmc: Fix an error handling path in au1xmmc_probe() Date: Mon, 24 Oct 2022 13:30:19 +0200 Message-Id: <20221024113000.327016644@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747571199484134903?= X-GMAIL-MSGID: =?utf-8?q?1747571199484134903?= From: Christophe JAILLET [ Upstream commit 5cbedf52608cc3cbc1c2a9a861fb671620427a20 ] If clk_prepare_enable() fails, there is no point in calling clk_disable_unprepare() in the error handling path. Move the out_clk label at the right place. Fixes: b6507596dfd6 ("MIPS: Alchemy: au1xmmc: use clk framework") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/21d99886d07fa7fcbec74992657dabad98c935c4.1661412818.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/au1xmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c index ed77fbfa4774..a1667339e21d 100644 --- a/drivers/mmc/host/au1xmmc.c +++ b/drivers/mmc/host/au1xmmc.c @@ -1114,8 +1114,9 @@ static int au1xmmc_probe(struct platform_device *pdev) if (host->platdata && host->platdata->cd_setup && !(mmc->caps & MMC_CAP_NEEDS_POLL)) host->platdata->cd_setup(mmc, 0); -out_clk: + clk_disable_unprepare(host->clk); +out_clk: clk_put(host->clk); out_irq: free_irq(host->irq, host);