Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp442346iog; Mon, 13 Jun 2022 06:05:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysO/Y0bCWXeZRXCi7uP199UgH928T6pVC6lQHoCzbSmMdsS2OZ4zM75fMwIO6dFpF9jST1 X-Received: by 2002:a05:6402:139a:b0:431:6b50:11a2 with SMTP id b26-20020a056402139a00b004316b5011a2mr42968138edv.72.1655125550542; Mon, 13 Jun 2022 06:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125550; cv=none; d=google.com; s=arc-20160816; b=VykL2PHIoBbuNmYFcQ4DJChHOWrLeslAyxBDsTKA0q0IgrBeKDoN/7uphkOGfeYZTY wE8gwEODc1DemjYdwZK9MO6nGfP9/hawe1hWABKE8b5Hb37oqZ9orPM9ooPFeAi48SHB Jlsk933EhLDzX9JvvAdf5M5BEIgtaGP1ImgaZBBQ2F3TRH6E5mGTWrnQLhQOpbzxabQS tKDYr85qI6e/vklZsdlXUbJUDunwhWO21BOnDXxpu6h+QgXE/h67g70B5vmfalE/ku5K DscrO5iXgUQmbuvIgMKpJPh8KrCZy3cswfoTAJG11PTn+kRdyvJUCbSXTjfpMlihQrW8 5ESg== 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=T9bZ5aMZEKPkNHjvAjEClIJwKJL5gRaJpD7uEPp4XPw=; b=l3/aN17mfuqkOOgyLX9Exxe56pX4tlONsCcNTqEpdyoMn9QS6zjYj4sBYDD11UyVTK GYVtR/hv3FeSzcjq2gW0XDohlSuMa16odVsw9tSuIsUqXvnqxcAu0G1mJp9HZQPW2Ndx EeetN4ZKJ6/PshuEEl3u+TxtFemQ6sn0nNJ8q2htrNvOInfuEn6LJs0h0l98DtKcwxR4 rQ/QZtd6HBRV8gOA3+8GIYgwFD0eqnhQTXOvaizdrBvIyIUt9cyjr75jbGMJmYLqCSYt n7Yxh1vfNDxe4A08+jVdq3Yin69UMvP/OiDAIY764Qz89XJjw9GPlZACghvvBkxjhIcs njzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gMXngnB9; 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 dm4-20020a170907948400b00718bf771995si3369937ejc.766.2022.06.13.06.05.17; Mon, 13 Jun 2022 06:05:50 -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=gMXngnB9; 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 S245056AbiFMK5T (ORCPT + 99 others); Mon, 13 Jun 2022 06:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349822AbiFMKyb (ORCPT ); Mon, 13 Jun 2022 06:54: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 B0D382FE6F; Mon, 13 Jun 2022 03:28:25 -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 43A6760AE6; Mon, 13 Jun 2022 10:28:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5270BC34114; Mon, 13 Jun 2022 10:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116104; bh=LUspz+JRPahVa/JqODn+Iu0gMILbTdena22bNZLzULY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gMXngnB9R0ZCqQDJPfbGulToa6+riBRbyYM2/W+/Pk6tADRj+q/1MUJsaJDaeoZc/ w8TXwcBlBjbN7Dwho2XBt0cUmZdGzl9F04ry8daZkZuRNvNKFqNCW+RfmYk2zi4Ao8 pc1Bz3RrhLNgif06dIFOuTCVJ4R4HsFJgV5Fd1hc= 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 4.14 133/218] phy: qcom-qmp: fix struct clk leak on probe errors Date: Mon, 13 Jun 2022 12:09:51 +0200 Message-Id: <20220613094924.615650481@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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 @@ -1123,7 +1123,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) {