From patchwork Sat Oct 22 07:26:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1105099wrr; Sat, 22 Oct 2022 01:34:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7eNtYWP5NuVaCAp4oZsTIJwjPZTf5NOUiuVWUn6fJAh43+GyvJ57VIudvvy+kJUcRVgWne X-Received: by 2002:a63:1c4e:0:b0:458:e183:1342 with SMTP id c14-20020a631c4e000000b00458e1831342mr19457358pgm.409.1666427647585; Sat, 22 Oct 2022 01:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427647; cv=none; d=google.com; s=arc-20160816; b=zOL0r+fZssZClDhLxe9zh6y4bZu7PrEj9H/Q0UvvLf2OCddX0Et2WRhq4X0ZLY78G1 WOx2sMkUr8HbahDsUPm4OBwMtA4RmBM6kU5eyk3UdB+CHK0LjjAOhsarM3bVsO01aIko +vXEyN8YJwqRSHVipmGuH9mMzFqSY5ec5YeW2un+5TQ+Q+pd58MY1JrSW7WqRLZOWkok GQae02Ln/mdjsFyat8pQ/Mo3c1jEpGAb/XAPH6IGJRslumAKzYcPFE/wUgZbh41peO/A kIQhERP/1bQ6D5Ue58O62mlNaMSydNB6AUi2TIUdBqaZ0yMeGfk17v7dP5XgcMH4Ka14 vt3w== 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=XFhQZio/J0Z6P9om4dxb6oAtl0U5fYzEC39QHLLbZaU=; b=S++5Qox0tvDwBYm1iYSb2nWj/gV8t3ijn/uN34puVjdso/QzCnkpmiAtlN4dg7XHUn 86j9DMadof61b5JR8n2exrLBoxzkzC2KVCtA85b66QOqN1tsr07534jXt1Z0tAl3LOCL zO2GzqXKNHlqPkR6wbyywZlNPFkfu+08E30fR2ZCCIpfK8DT4cVh7VaEQNKiZCXDlTQq zbF2C+u6//KdtNCPyeZx6R6rqVwqCRJoRgo4smFe33G72N8IR1z1t7uEg49Lyxg0kXzJ /24FxF/HOADrVjaY0rAnax7VIlokhOtJWHuzGexNi6hGPr4iNAdsyw04ZTbrXvIxPsLp AHUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Rhpd7Spz; 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 4-20020a630c44000000b0043980f3cf24si28958038pgm.296.2022.10.22.01.33.48; Sat, 22 Oct 2022 01:34:07 -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=Rhpd7Spz; 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 S233740AbiJVIVD (ORCPT + 99 others); Sat, 22 Oct 2022 04:21:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233769AbiJVITb (ORCPT ); Sat, 22 Oct 2022 04:19:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 634C52DF469; Sat, 22 Oct 2022 00:58:20 -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 B38AB60B9C; Sat, 22 Oct 2022 07:56:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFBFDC433D6; Sat, 22 Oct 2022 07:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425399; bh=jf8fLkWoIzpS9etIYsFt+wUCczoUIgrZFu4evcQxtgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rhpd7SpzYqBA3FzSalHFvIqdNoZZqhPgpPlWfxl2Y1Qua45BzjCyRHLg3p9dhucG4 V39SE0o83+Wd9z7DyUtcbAC2ONMdjmvYgR/oinUt9nnrng00+8l2ZATKgiNqKPO97n MmFddqYmXjt7/3sVjx4yvYFoxWe3q7sxGoweCbwo= 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.19 487/717] clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe Date: Sat, 22 Oct 2022 09:26:06 +0200 Message-Id: <20221022072519.891186190@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376037160385502?= X-GMAIL-MSGID: =?utf-8?q?1747376037160385502?= 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 aa0950c4f498..5c278d6c985e 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -253,14 +253,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)); @@ -293,8 +295,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; }