Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp447074iog; Mon, 13 Jun 2022 06:09:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBXT3OkDva+3HNlHm174d81JC7KDImbXOCtKt4ovl53eL74/OaHIc3nP9MhNPyTKgzclrv X-Received: by 2002:a17:90b:3e85:b0:1e8:8e0c:88de with SMTP id rj5-20020a17090b3e8500b001e88e0c88demr15648667pjb.151.1655125664641; Mon, 13 Jun 2022 06:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125664; cv=none; d=google.com; s=arc-20160816; b=EZ/2ODgtjVpjNGGvZ0oQk+5lYX8jBikgSCdsKU3Mp7DfxGPplr29kwG8PLqnlOQT1F HcJEztyy8WF2AjyVziw6mwBGcR4RXT+P3qKok9FJzYRAB5vAUmzo79QGucqh0Luo0H3J Z1oYCWYz5mY3Q63XrSunecESixIq3BM5R8D2FNKxHsQ8B6IOLaSuBwyCFJ/guKqSHjTP Ewjkmujzev+eLHNCr7YMCGXkwJbF1HaAOiyydB2cMOzujFAT61ODPwDTnEtgDje5UiS5 kpg/UcchGWZ9RskR1TF/AT830OgAcF2eeJKGQwZmV9XFgfnFOai1VS5DQhC3PPCz3umv q4iQ== 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=alVxrTFr9iaccW1rtwEnI2IvD1jNF5xzJDUBkYDGnAw=; b=OTMlydxckLJ5xYGxeg3bed8FYyu2aOjb/9nkQSlPqyDM1z+iTxLUA63DWoWomgTu5z a6dt7aMk6NyuOzpsInXDFDoWDMSk575JiKe5dl+OdpVqR0juHPDGre3xNCb1noIIr+kF Z/QuGU8W0LSCaR89RcCURslAdIGjBnuxp++79PHksPRBhxQMLNfxxsgYmkuTYBXkkYGX 3SYh+ftE45aUuVtJTOe0vLxj105czoVsn8W3XoreguYi8rOl+oBp6JCDZ+quutb2tECy 6VuqyfhfHUPkk6QStxZ+rHL+IS1MNBpvOrgSor/7OJlAgo9D84b5Eclqat1IFc2SGIY4 pLpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xOhRpwCH; 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 x126-20020a636384000000b003fd1dbb91c1si9305514pgb.727.2022.06.13.06.07.30; Mon, 13 Jun 2022 06:07: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=xOhRpwCH; 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 S1355038AbiFMLeX (ORCPT + 99 others); Mon, 13 Jun 2022 07:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354395AbiFML31 (ORCPT ); Mon, 13 Jun 2022 07:29:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F6E9BF7E; Mon, 13 Jun 2022 03:44:02 -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 8E6DC61016; Mon, 13 Jun 2022 10:44:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97F3AC34114; Mon, 13 Jun 2022 10:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117042; bh=2GxNHxTzYTOuyt9YaLzB4zVVZgJb0OBNOJq0mhVsJ8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xOhRpwCHJ0IncWS1No8eZukBjIjeqV1Z4DfGvg875Du67oBb4ZVPcKmQTdOH5qqGs cczAoijvpdvtcerH75jk/ghFNsRnkQaDZOPNxcEttyveBH+3coZ/F2BHbgiPmhZCC+ 9E2B1g8yoVoomoiJ2XXeb8Z6PCUKjtLwY0h5QW0g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vivek Gautam , Bjorn Andersson , Johan Hovold , Vinod Koul Subject: [PATCH 5.4 265/411] phy: qcom-qmp: fix struct clk leak on probe errors Date: Mon, 13 Jun 2022 12:08:58 +0200 Message-Id: <20220613094936.706573038@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@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=-8.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,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: Johan Hovold commit f0a4bc38a12f5a0cc5ad68670d9480e91e6a94df upstream. Make sure to release the pipe clock reference in case of a late probe error (e.g. probe deferral). Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Cc: stable@vger.kernel.org # 4.12 Cc: Vivek Gautam Reviewed-by: Bjorn Andersson Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220427063243.32576-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/phy/qualcomm/phy-qcom-qmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -1929,7 +1929,7 @@ int qcom_qmp_phy_create(struct device *d * all phys that don't need this. */ snprintf(prop_name, sizeof(prop_name), "pipe%d", id); - qphy->pipe_clk = of_clk_get_by_name(np, prop_name); + qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name); if (IS_ERR(qphy->pipe_clk)) { if (qmp->cfg->type == PHY_TYPE_PCIE || qmp->cfg->type == PHY_TYPE_USB3) {