From patchwork Mon Oct 24 11:31:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9623 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp531540wru; Mon, 24 Oct 2022 09:06:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM44dNDIL6Om0v2s5fsP3t+76WAooqyW47br9+NZRZTohagO0ILcC3SzobCxqZK/KZu571b9 X-Received: by 2002:a17:906:478e:b0:78e:4b5:a547 with SMTP id cw14-20020a170906478e00b0078e04b5a547mr28526395ejc.81.1666627599404; Mon, 24 Oct 2022 09:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627599; cv=none; d=google.com; s=arc-20160816; b=fpH0UeqF4jjC+sIJfEzmMHTD77AlaCjNf3Suf9lMO2TBMhBDRGh3KhHnEN3q3p5vgA bxHH29zHuUVrUocMf+D+QxqSmp1yvJw4rvrXrBPrpEw6SFO+zPqhaJhbwQDiJP+QuLSr mo9/yrVjKLjaGZ69wbCalEDWTVVH2QnoMsKdkOkYWBabfSEdoTogc2nVKDIQhhA78TTw qwWTwveW7LWH70BUQg4SK7S6tgfb0m/lNsxiSP4CyiEt0Nv9aTHv3Kne2t/7uggdV4wX ug0GjCD20w+TRmTgh1t+YxRtoKFRSwg3cgcpY4W40Ejf5mUhVbAhMn0RmcWnPOZ1rS9J I0YQ== 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=LWy2XAGNA5ZZNgHXXcVrR1+HaYsbKEPO+cXv9RgMG4Q=; b=BS/KhVTo9AECnNX0bNoPY9KGUg+iWxN74lpPcvuys4g9AduWYiX0uw/pNAQDM0XBZp G8653H6nP+Qb8RGwrT3pJ5Ud8w1eoFS3dgqPM8jmFQ+PzNzdqbHxemsclB9mALv+IGJ/ mhUrbbcukOokCE0O9yOlxwPrpXfzx7pmGWnwFqp6fHXlqbWZ790JqyfGyP8X3SDTvBnw Q7RXWahXM3oQkXGEUo1fpId5ni2UiNnnHPJekgm+fUMSWzwDwmfOKkXPPWQTukIzMv49 h6LNj05pMP3xYUp3Bv4Eoy80wqDsTN4W/jrxuaMnwtqsADTk2oGk/GIrvuXOnJDnY0Bt dqSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z3qw8Kkp; 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 q5-20020a170906a08500b00780cb1272eesi97353ejy.466.2022.10.24.09.06.13; Mon, 24 Oct 2022 09:06:39 -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=Z3qw8Kkp; 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 S232527AbiJXQB2 (ORCPT + 99 others); Mon, 24 Oct 2022 12:01:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbiJXP7P (ORCPT ); Mon, 24 Oct 2022 11:59:15 -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 A506E46225; Mon, 24 Oct 2022 07:54:44 -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 A85E2B819D6; Mon, 24 Oct 2022 12:48:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08969C433D6; Mon, 24 Oct 2022 12:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615721; bh=bt/7eh6FfydEePQtgDsOro6ZK50zNzKZYCGlPt6CeTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z3qw8KkpiV2LOxQk1RoVVE4tl1/ytIXbdTrzE9brnXpsg4Ylpv0S5nQxKz0xqPoB9 OqNpojA7ShhodkKACvwcDhUoiqFiw2UY28MPktrCFtxRlnaVzDZb7FUbxegaWttFpK obi3CvlaHV+/63xTo00FWgm4m2sWKVpnVjbBB9Bk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Tony Lindgren , Stephen Boyd , Sasha Levin Subject: [PATCH 5.15 357/530] clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe Date: Mon, 24 Oct 2022 13:31:41 +0200 Message-Id: <20221024113101.192283753@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747585701952560159?= X-GMAIL-MSGID: =?utf-8?q?1747585701952560159?= From: Miaoqian Lin [ Upstream commit 9c59a01caba26ec06fefd6ca1f22d5fd1de57d63 ] pm_runtime_get_sync() will increment pm usage counter. Forgetting to putting operation will result in reference leak. Add missing pm_runtime_put_sync in some error paths. Fixes: 9ac33b0ce81f ("CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220602030838.52057-1-linmq006@gmail.com Reviewed-by: Tony Lindgren Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/ti/clk-dra7-atl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c index 8d4c08b034bd..e2e59d78c173 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -251,14 +251,16 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev) if (rc) { pr_err("%s: failed to lookup atl clock %d\n", __func__, i); - return -EINVAL; + ret = -EINVAL; + goto pm_put; } clk = of_clk_get_from_provider(&clkspec); if (IS_ERR(clk)) { pr_err("%s: failed to get atl clock %d from provider\n", __func__, i); - return PTR_ERR(clk); + ret = PTR_ERR(clk); + goto pm_put; } cdesc = to_atl_desc(__clk_get_hw(clk)); @@ -291,8 +293,9 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev) if (cdesc->enabled) atl_clk_enable(__clk_get_hw(clk)); } - pm_runtime_put_sync(cinfo->dev); +pm_put: + pm_runtime_put_sync(cinfo->dev); return ret; }