From patchwork Mon May 17 13:20:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 12261961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1C90C43460 for ; Mon, 17 May 2021 13:24:44 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77C9F610E9 for ; Mon, 17 May 2021 13:24:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77C9F610E9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ow5wObPyQIzAl4HEH31jpqoVAYbko0q5Vpi8UmHHmus=; b=YLszSaUxjHsBZkEi6/L+vJHgg8 ckp3gVLvb49QFUrfLMYE1yDqMEMThBETY5irKQaw+ux74rCAFrFdVRzrH6bXfzEq9gsNYt9I0kOVc Wz5xDi3o/0jUTcE1ge7M4YgRkc5IFxbiggbQ585mSlt0KrT2oFiC/3cE06dSzSMf1XsUu85Np80RU GgEKe5ryVp/wDmiuuM1D/dlVC3DlLFNx+dzEyUj6/iQ/BmM4swCDFpEa4SBv3CzIWNjSspi0hvBM9 MhU7dV8HbqJFhIB4M3E4dRDVLRG2n036x+7bGwLYeFVNFj3qV0yrGdcag7vCmuF/qBbUihYQA5CzV TlH5O6vA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lidEf-00F3wL-Cm; Mon, 17 May 2021 13:24:41 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lidAO-00F2tl-5p; Mon, 17 May 2021 13:20:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=DMZMz9ugGBXkoKCwmBbR40flsKXt+rGpdXgSQkZS0/o=; b=ZucmrVGYKIfGTc0oV/cr16aPaG Wizsmv9aaD06b9/E4I/4KGqF37sENSNECQiI5OlU/7P2I3i8ddV7WFafgYEZ5TBx/3dza0RMTB2ES N0+wpz1QYAAIrRutEpgrCI1EswVeHsEm4A+epjdjPVF/KKlwoMfrag5m3yH0ElUsi0OagF7t5EWvV kTsUPN4ZG03VvzD6jcSuT4PSAzR5Jh6ZeZfeJRhqjZifbns6w7u8OmFIdWFNSqvbksvmC+OPMtO5O 7E8KS/WeT8j4OIE/FG7IxJN4aJ6ZYuJG1tYiCC0VtnrN5yKBfgquEEyx8I9nDROt2s2hB0T5xMFeN 4oKvYxMA==; Received: from mail.loongson.cn ([114.242.206.163] helo=loongson.cn) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lidAG-00DnIN-Bg; Mon, 17 May 2021 13:20:13 +0000 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--.37607S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtr43Kw1fZF1kKw4UuF1rJFb_yoWfurc_uF 1vgwnxWan8WF1akw1UKr1xZFyI93W0qFykGrySy3yFkryjgw1Y9rsFvFZ3uF4DCan3CF13 J3s09ana9r4xAjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbsxYjsxI4VWkCwAYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z2 80aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAK zVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Cr0_Gr1UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628vn2kIc2xK xwCY02Avz4vE14v_Xr4l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2 IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v2 6r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2 IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2 jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0x ZFpf9x07j5_-9UUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_062008_785017_2E3A940A X-CRM114-Status: UNSURE ( 6.19 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.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 Reviewed-by: Chunfeng Yun --- 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; }