Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2865240pxj; Mon, 17 May 2021 11:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTnwsHxtDfnP4PYf7FYK+GOYG3Pd1beif/Z2JyGLlY3OKwL0cXHek9Gix3rZOW5nvVaCSw X-Received: by 2002:a50:ab52:: with SMTP id t18mr1798723edc.188.1621276700182; Mon, 17 May 2021 11:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621276700; cv=none; d=google.com; s=arc-20160816; b=Tx68bTBmw2FGHAy/Vgl4kxR7023dTLRE+yBzm/2XPDVq/GuhJYF/oi4pHpRYTNm29Z UT54b9jbZSKVXAypgQD80pAev5Cf9ctk9kiblDOsq10EgLqhylTxC8dD0vi1Cy1Vs6b8 7XZL3PfI3cS6bEAQQz7OoMXT+BLSLXUZ6Ph2qvLv56C6r22tE5E6Uje2AkuVu+1tALOo 5uAq6/hWyyk+Wt2aD5MB72EgjlyiUJQETwKqcgiaTahokpGdgayvlyD8TEvAdlvsHIGX vuB4f3MmR/ow9iUZuvCgDRECpGKXAr7cap7s1CX83NQfO5ZES4xtpFxPuspdH6XUkkHw sMJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=DMZMz9ugGBXkoKCwmBbR40flsKXt+rGpdXgSQkZS0/o=; b=HQeJ/WNf8nPkHIb3Un9SC5H7vOE6Sgi5HSAfbtVmaFl5DwOQbpBmK0bJWUYShautqG f3Q3fx2Xnc3UyMK9IVt7ocZAmlZIpUSylMMdZFYecTLznbRLY/mlN/1Fn+y1vigD2kl7 rr1f6RPT+x+oY8HxT2lS9QJoaI8b0MttOJfzbibGjVWiPDPq2GL8SVmR/eHFfoFqKDT5 TMx8zQJivGERJQnihfto02/RKRGA0xI/5W6tFor8h50EgmErspjjaMAqA09HUw5lq4Nr EoJQ/jsj1zKmzaI8iGtCyTVChQM39BKWogQ74SOLiagVuJIeTGQNr7+xb1iCwAavhCJR FS0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si15916575ejj.664.2021.05.17.11.37.56; Mon, 17 May 2021 11:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235866AbhEQNVc (ORCPT + 99 others); Mon, 17 May 2021 09:21:32 -0400 Received: from mail.loongson.cn ([114.242.206.163]:42174 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235627AbhEQNVb (ORCPT ); Mon, 17 May 2021 09:21:31 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Cx6cmAbaJg5GwYAA--.37607S2; Mon, 17 May 2021 21:20:01 +0800 (CST) From: Tiezhu Yang To: Chunfeng Yun , Kishon Vijay Abraham I , Vinod Koul , Matthias Brugger Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, lkp@intel.com, Dan Carpenter , Heiko Stuebner , kbuild@lists.01.org Subject: [PATCH] phy: phy-mtk-tphy: Fix some resource leaks in mtk_phy_init() Date: Mon, 17 May 2021 21:20:00 +0800 Message-Id: <1621257600-15046-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Cx6cmAbaJg5GwYAA--.37607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UUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use clk_disable_unprepare() in the error path of mtk_phy_init() to fix some resource leaks. Fixes: cd4ec4b03dc1 ("phy: phy-mt65xx-usb3: add mediatek directory and rename file") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Tiezhu Yang --- drivers/phy/mediatek/phy-mtk-tphy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index cdbcc49..731c483 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -949,6 +949,8 @@ static int mtk_phy_init(struct phy *phy) break; default: dev_err(tphy->dev, "incompatible PHY type\n"); + clk_disable_unprepare(instance->ref_clk); + clk_disable_unprepare(instance->da_ref_clk); return -EINVAL; } -- 2.1.0