Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2198812iof; Tue, 7 Jun 2022 22:59:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZTIjV1BV+zFcmqvaK8mdfzVXoTj3DBpdCPwxg6WJNCoVBf469PjG2nIJmZpGK2UGnUZ3D X-Received: by 2002:a63:6b02:0:b0:3fb:da5e:42a1 with SMTP id g2-20020a636b02000000b003fbda5e42a1mr28923972pgc.273.1654667968058; Tue, 07 Jun 2022 22:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667968; cv=none; d=google.com; s=arc-20160816; b=LLa625qJrm9fce1JjeazxRKc74qYVlbUs7lH3G+z88x0eGDkTpnWHIpl4zFAZRNneA 7HL7Semjp9XJxqPQIySTNO+8xV1QNi9CzL/ZBJig1ckpQJPn6QzAMCrlLAWaBiEGRbWc K4hgrpEWytT4+mN8wRn3GB9CzmXbaQYH5qf6/M18IiunS/uELDq3U2gt63Sel1oJY1TG HP8wmHK/4OIpYBBSN8x/Q/xrP2X3WwoWoLelAMVKDTYUOUCx+eK4kdY7bdBCWXSJGpcl FcQ1TQkt5mh9Iw/gUUsXyuTZVlsH8yrym4zMlJcEaffi0RtUYsHCu4Av5EoZePUcUA/y X1cQ== 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=INqKvJrP0V6EUaZGYHxmcAE66M8z7I3Ev7VgGAdJTeo=; b=qlv/6o1pcj30TpNZr8tB8MpT9gLOoiKW9JpNVLlbkFOeBzKsU58P+RpXm67gpOR7tp SCc5pClDFLhGjoSUubCvXMjdH3m1LFzgYO/hQnedkX3X4Hz/g8Yg8+KNxMGUGr4rLnd0 mXofP/Lj2ge26dk1kmro6X5JFmKt6ulX0jthADCjLcV2EqP/pDIid+yAyrj5hpHdcAny mDTItSwCsCdxpF0W3jFrW3V5h8NYqojA2omnKLIkF1WYPgIWC11nWQBB+OM0T/Zr/+hA GegwC1vdXsRPHChNVfO7syp/TLXyquJqoCEJhO16MuMy8xH2hilXI4zZ1kDcGBrh4hXI hjQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G2tyl6jT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x20-20020a17090a531400b001c9e16e3b0dsi21322806pjh.73.2022.06.07.22.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G2tyl6jT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E1AA1FF61D; Tue, 7 Jun 2022 22:26:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229926AbiFHBRw (ORCPT + 99 others); Tue, 7 Jun 2022 21:17:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385515AbiFGWbe (ORCPT ); Tue, 7 Jun 2022 18:31:34 -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 D38EF27B490; Tue, 7 Jun 2022 12:24:58 -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 89EC6B823CA; Tue, 7 Jun 2022 19:24:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF1F8C385A2; Tue, 7 Jun 2022 19:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629896; bh=4Wlc1BHfcp7K3SVwrbuEW60ljxGlDMXggyJ2yaEMzkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G2tyl6jTfZjsGD5ZDAJldiSu2FaMrEaOJfFy5WK4IB4RAt5B0xlaCDetl5ecO7j50 4cwUPIfVmeC85U9sLiSdTudcPJ+R9rzzwAewLffD41uvlnzW1pvQG0fRegfVL5R2zB kVrp4aNNCTfkYaF566dWIFojI1UQ31fCVl4pUcGs= 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.18 849/879] phy: qcom-qmp: fix struct clk leak on probe errors Date: Tue, 7 Jun 2022 19:06:07 +0200 Message-Id: <20220607165027.494409359@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 @@ -5890,7 +5890,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 (cfg->type == PHY_TYPE_PCIE || cfg->type == PHY_TYPE_USB3) {