From patchwork Wed Apr 27 06:32:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12828326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77115C433FE for ; Wed, 27 Apr 2022 06:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358160AbiD0Gjp (ORCPT ); Wed, 27 Apr 2022 02:39:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358172AbiD0Gir (ORCPT ); Wed, 27 Apr 2022 02:38:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6AF71D0F4; Tue, 26 Apr 2022 23:35:36 -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 0269C618E6; Wed, 27 Apr 2022 06:35:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51659C385AE; Wed, 27 Apr 2022 06:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651041335; bh=JfzgUR4uDHZ8zRHtskqu08bEed+yBY133dHufapfmEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ck2iTmTAsUUE+2D6iR06PiNIQEb3JVDPmJ/lSsITZzm4JPbZKC4MxuuExgzHZIHHq RoqbjVKSKVn0y0+jkWbMXokKE8r6W86yXyaVZPABz/P7vewdNniI1XMlnBLYf8DDjW UOhg0CR/YbrMCUETIl91yAhATYI28NAOsb5ULeuNLJFAV4sDAygb/LWkEOAgaE+6yN dzFx3U8d6xOBCoGgKHlSWCsn/S+fBBux6nCockyprv+GapCU8YkURuqIsvGCRSZgqd o8dwRb/ep5k785B2A7ZxN40bGwWDIYFd131ZT+ue9zTHiShoWFHwL+ncsIDmvL8goR 7Wk5CVwJXViiA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1njbGy-0008VV-UJ; Wed, 27 Apr 2022 08:35:36 +0200 From: Johan Hovold To: Kishon Vijay Abraham I , Vinod Koul Cc: Andy Gross , Bjorn Andersson , Philipp Zabel , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org, Vivek Gautam Subject: [PATCH v2 1/3] phy: qcom-qmp: fix struct clk leak on probe errors Date: Wed, 27 Apr 2022 08:32:41 +0200 Message-Id: <20220427063243.32576-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427063243.32576-1-johan+linaro@kernel.org> References: <20220427063243.32576-1-johan+linaro@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/phy/qualcomm/phy-qcom-qmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index 7d2d1ab061f7..a84f7d1fc9b7 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -6077,7 +6077,7 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id, * 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) {