Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6740667rwi; Mon, 24 Oct 2022 05:38:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4j5Z08CZCDtBZHtTYvddjV2P51rnFHz6jLcNgFXsBdpD8r5wCs0kfrXbkWLGt+yBqdmBjA X-Received: by 2002:a05:6a00:1595:b0:563:8fb6:ae53 with SMTP id u21-20020a056a00159500b005638fb6ae53mr33260510pfk.51.1666615124727; Mon, 24 Oct 2022 05:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615124; cv=none; d=google.com; s=arc-20160816; b=Ur+a2UnGX7ybdFbxeXgURc/stY3nIhYmVE1H0/dWDebzBClyglBP6K08CfmfblBNNi z1CrfdUI9fje+rKkYTrMdlxQYNi06ojMBIEz9u+i4EVSfSX35k4oFKRZy64UxTDjiUo7 rQCWDuypDRiu9nG0s62df8FSCO3kUaFh2i8tVokTUO8ptUqZuDPH6E3sKUIAr5Y4mPML aJYvrnCh9A+i7P52zxzjBhcMpcxCIAweNhSaVp+gM9vHmcZvHkGazDWTqvWkVr6tPawl ZEpdy+i0PnXp6ze55IxL2ATrU89/L9sciUF4eXUfIrFtv3IGPheUkgvvAFv2zFYgwpQl 5jlQ== 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=zxz2aFx3qD3JbKa/GPaw/tyif26U2V5X9sHZVfTfK/Q=; b=WAiguYWCBosJtwaLTPYeKFoInIYhEcM8bvRN9N2NBdmAXwnj/uKQBgC0YMm6tZlZyg N1HsRObjvxbCyprEnrMiwSafG/cd2eBThLMhIpNUcV4W5iSNqHYw9SWOlbnNtsli0D7M Iw+f/mpLNbrnFyQhbE+9ogHlsgVigdnK2q0/hPa3+OVHZMOIQZhwovDq5VV/cDpKJ9+W asiqBnbe5X4ZF+XZQ0qFASO6h1F3Ki6hhLptmM0Bs9pFFv4Y2tExyHf9rzqjQfgIf3Ue Vvf7ZJxrsYSWHadDFA4WMS7fWOEwimDwTCuWYhYloD2VWooo2qAbHCng7ib6EHnetUsf fPUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ORiidTyu; 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 c18-20020a056a000ad200b0050d80e4935fsi34330206pfl.256.2022.10.24.05.38.32; Mon, 24 Oct 2022 05:38:44 -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=ORiidTyu; 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 S232819AbiJXMLG (ORCPT + 99 others); Mon, 24 Oct 2022 08:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233133AbiJXMJq (ORCPT ); Mon, 24 Oct 2022 08:09:46 -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 ED09B7FE56; Mon, 24 Oct 2022 04:53:03 -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 308FDB811BD; Mon, 24 Oct 2022 11:51:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8830EC433D7; Mon, 24 Oct 2022 11:51:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612310; bh=rJmvJX1Yd+VCFEKraff9jIv/6wTZs/svtd+hRJMqLjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ORiidTyuUdxkJEFguaQY6akdLgOTFhZlCsYVP/OPWQYYFyKFw41bP+awILNwmS/2s 1Ex5AifMtb1KVecW+T0J8+U3Dv93Eu9OVQZK7xVbW5sOze0BScz6ZkUWa6PjePT+Ap lGbacPB1HPYsgTntP604Q2bTq6zacU67wWyiLu3Q= 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 4.14 150/210] clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe Date: Mon, 24 Oct 2022 13:31:07 +0200 Message-Id: <20221024113001.843666014@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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 beb672a215b6..a4b6f3ac2d34 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -252,14 +252,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)); @@ -292,8 +294,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; } -- 2.35.1