Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp1548018lkv; Wed, 19 May 2021 12:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgQI65dHnTl7LiJny1wo11z44++DntBMpix5Z7yduiUbYVh4NmGOWw6FHJszPfVVmI1h6m X-Received: by 2002:a05:6402:3494:: with SMTP id v20mr653760edc.169.1621452598200; Wed, 19 May 2021 12:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621452598; cv=none; d=google.com; s=arc-20160816; b=FCKmrlLw2kdTtLKCitjklrfP1MMZvSDiVIrXDI0id91Nrxuv+ayletrDINivt+V9fU x5sjEuw9Tv7FvoqZS3Bv7Enu5qVqiMmW5EzIq/jxbeRlogAeoEhGz5gFPssFUMHO3YPC n+aMEHwBlq0/e3XgUYbXZTkCpyKFBxJz9yv3jdFdLo+NIy7HBCXqWmHImFnivf5H+boq 9Bw8zZ1ZbQOl4xv34ixfesq3grCIdoETO1D7eeAZB+q15wHTmHOu5vksyEfyAAO7OvZE FJDPiVWN1/nH/J6LEZ/KoC+xp9XQ44oqeLDCth1p2mWLH9EqCb4tWdE9ViTL+/dz1w3l FgWg== 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=fSQxLIF+SSmuLxcr9AktDMU7JtES+LcxCeHLO/dMRSc=; b=KoYyK+HYVBrc0DI28RoaUCrAgAykD8imHnJzHrMCWMr1BDhPC6lLVG9IbKiO0Qnbfa jm62wYR4escJxgUFYhJjuzQKQNRKEYSVGzbXCkx06UnckUBRydHcB5F2ffdK7KxHzJqC 2g3z4g0SqoeD/0NDWG0R15OhuUW1LggSjAm27u4H6Xvni+Xq0qcGo5cy9X/Bvik+ZVE3 BdMvclK3oe/7tEzXJ9QG3LTuwWSmkaCR7k0Ej57ZGqQLbfgsAVweV9+DMENITq6rhp1c KUnd6xptsDaDOcsAsqHvH6h0oz0PoSmUAhV7f4MFAsDTf/8xR3Utcssv+ZA3zSTf5i8r oXQw== 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 dn20si487058ejc.125.2021.05.19.12.29.33; Wed, 19 May 2021 12:29:58 -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 S1348200AbhESKka (ORCPT + 99 others); Wed, 19 May 2021 06:40:30 -0400 Received: from mail.loongson.cn ([114.242.206.163]:49784 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1348073AbhESKjR (ORCPT ); Wed, 19 May 2021 06:39:17 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Bx0OJz6qRgrKcAAA--.3389S2; Wed, 19 May 2021 18:37:41 +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 v2] phy: phy-mtk-tphy: Fix some resource leaks in mtk_phy_init() Date: Wed, 19 May 2021 18:37:39 +0800 Message-Id: <1621420659-15858-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Bx0OJz6qRgrKcAAA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DU0x ZFpf9x07jOgAwUUUUU= 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. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Tiezhu Yang Reviewed-by: Chunfeng Yun --- v2: remove Fixes tag and add Reviewed-by tag 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