Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp707853pxb; Tue, 5 Apr 2022 19:41:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqhdj6iaTb8tjVZ09M5HaWFquNMp/CyggjB+0B5eJVT/GekbPHWWjAWURjC+hVAlw5uqT6 X-Received: by 2002:a17:902:8c81:b0:156:7fee:643b with SMTP id t1-20020a1709028c8100b001567fee643bmr6403856plo.59.1649212879367; Tue, 05 Apr 2022 19:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212879; cv=none; d=google.com; s=arc-20160816; b=hdQiMf20l5tmuIbarypvdmDV3Bk49eJg9MxkxpKy/5aLunenELja6nDL5d9fWpscPB ye2Ss549ulgbFPw9VGQK+/U4PNlP95CTMYxehh5i/0mICcxpOhc6DJZNvdGQrpLyMEQd +Svtv5+kLdO0SbGTArxk+vTqMW8C6RgJWJ9B8jEUSSVOHTaLFiKIOPoa0YBV2MdLKoLH wm87/UyvjWkEBWEvBAHrLdbaPr/kwEg0THwXk3+DtM7DQoeNLc3IB7bRBGcD/+Wmogyr pFfk0jR9HE/tYEpXyZeOyeTF3Fifm1ecdI/a//lSAMcOgkAayLxSKI9yEKJQMwRuu+ZL ewUg== 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=S4Fl4MWD0eBir4tTAQI4GJwA84mIuf8HcTEP0qo6Ctc=; b=FglELr8YATvkKHNDGMKy0hVbmdUghuas7yJJrcqlTu28N9zNVE6u0fI1b5WiGHqdl1 foMVOO0hSAsoQw9/lzEqjpmWvUg6wmjZ87KJ6Fi6ggm8xKB2HX78IcGLT+0ykFfNjmcS x1hd5SkMZlEJAWQ2SMWmI9nvp3pDipqov9lhkJ8PjaXH6jbO60fxbRgWBU2yMnXbOZ2b gpi6l+pYAzaauTqvZAS0XXSo7q9djoYH+EomhzODpzG19KOqCiBilr9u05ktQR84tyoj ZxG+XOXlNu1OLjEw3kQ+TdlHuPfT0PGHo9bBlw/4VgyTobbOWVeTjq6He2oBlX3kWkN2 x/jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y+5HSTld; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020a63cd45000000b00398580600aasi15383664pgj.433.2022.04.05.19.41.00; Tue, 05 Apr 2022 19:41:19 -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=y+5HSTld; 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 S1381753AbiDEL7b (ORCPT + 99 others); Tue, 5 Apr 2022 07:59:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245057AbiDEIxE (ORCPT ); Tue, 5 Apr 2022 04:53:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F74F76; Tue, 5 Apr 2022 01:50:53 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7A006B81BBF; Tue, 5 Apr 2022 08:50:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE210C385A0; Tue, 5 Apr 2022 08:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148651; bh=RuudkV80NbnUWQJ3ZBBUJ5p0VXcyoR2tIBAnss2jxn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y+5HSTldipMgndUHybpyArCf1H8eEkbTfjbGyxf/ZS+3W/xAxQRqmNoH3hYgCzgJw sO6f6aJLraM82JIcwzOTGlqSlOoXumgjK5AWOjcufdPTXwec0r35TgSTkwJ/poMXCV gytzNH+UcPDsvI5C28jIX+RnSmmuWHDMJT2BWKHo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.16 0393/1017] ASoC: msm8916-wcd-analog: Fix error handling in pm8916_wcd_analog_spmi_probe Date: Tue, 5 Apr 2022 09:21:46 +0200 Message-Id: <20220405070405.951366644@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: Miaoqian Lin [ Upstream commit 9ebd62d60edcd4d9c75485e5ccd0b79581ad3c49 ] In the error handling path, the clk_prepare_enable() function call should be balanced by a corresponding 'clk_disable_unprepare()' call , as already done in the remove function. Fixes: de66b3455023 ("ASoC: codecs: msm8916-wcd-analog: add MBHC support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220316041924.17560-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/msm8916-wcd-analog.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index 3ddd822240e3..971b8360b5b1 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c @@ -1221,8 +1221,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) } irq = platform_get_irq_byname(pdev, "mbhc_switch_int"); - if (irq < 0) - return irq; + if (irq < 0) { + ret = irq; + goto err_disable_clk; + } ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_mbhc_switch_irq_handler, @@ -1234,8 +1236,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) if (priv->mbhc_btn_enabled) { irq = platform_get_irq_byname(pdev, "mbhc_but_press_det"); - if (irq < 0) - return irq; + if (irq < 0) { + ret = irq; + goto err_disable_clk; + } ret = devm_request_threaded_irq(dev, irq, NULL, mbhc_btn_press_irq_handler, @@ -1246,8 +1250,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) dev_err(dev, "cannot request mbhc button press irq\n"); irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det"); - if (irq < 0) - return irq; + if (irq < 0) { + ret = irq; + goto err_disable_clk; + } ret = devm_request_threaded_irq(dev, irq, NULL, mbhc_btn_release_irq_handler, @@ -1264,6 +1270,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) return devm_snd_soc_register_component(dev, &pm8916_wcd_analog, pm8916_wcd_analog_dai, ARRAY_SIZE(pm8916_wcd_analog_dai)); + +err_disable_clk: + clk_disable_unprepare(priv->mclk); + return ret; } static int pm8916_wcd_analog_spmi_remove(struct platform_device *pdev) -- 2.34.1