Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp267554pxb; Thu, 12 Nov 2020 03:24:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCClL9llFIIUaJxQsYltb5gkVs+gPRZ7HiGr/a1Ui2zptvr72/jYXjbzxfgvd9TglkoU0l X-Received: by 2002:a17:906:491a:: with SMTP id b26mr29535753ejq.385.1605180277686; Thu, 12 Nov 2020 03:24:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605180277; cv=none; d=google.com; s=arc-20160816; b=I49pVjjiMC3kGGOmNv0UEAgDQftC/5sZWaISf0Gem6x7HlL+e1VLZY64Pju3wWvbwP g2ovK5WbeA1nj6e7mFPeiJ+uNjJv0EzmfNknoZGizrURGdpVxKb3P6ncYI5Ew/gQvFU1 vnkwlegoKRRXDnj7qxB4SC4684tiQ1mOEkRXXjK98kBZzl5MjVJkvgtF/GLEO9wf0oAd HI3k9Rh2C35dKn3a/NXsAhdFctbGf50EzYoaAimvQgGwGIe9hrNbSTGhbj+SuMuMEcQj NkAAfeQrRJROXhEs11XoB7GoYEUA/ncxHyjd3CCL/mrfAu4OHAoi+IBWC+/3SPEbeCWq 5c5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=4Nq0bx3VoDHxg6n6NtXx96Yv2BGsyt86MW0wUBf+kjU=; b=UewbiwLwOjVJaJIhnZ23N2uCfYAs4dI0QUX6yj0AeC0kzd+PMop+23GhRQVLYkGOH6 zaO9RTFC343BdXN32RWGD/0PL2johp7Meqy9J2PgHM8c2KBwDdYGx7skXCt6arfMHUkn JKgWlETmvpzaxHvzEVYbwoFLUteftxz1cKoW0BY7V1VEMssoQF5gCCJLl7MHED3gCnCB kcevJba1sX0YtrVEYqDS92YWHrRfv+qq6LRh8cDa1vWKMYw/7gGG2ojsuPxIzSjWRGab 31kYtvRE33Busa+55x43WWSij4QLc0x6DXVJwkn90onn46QoQFK8k8WjM+AnvSIjUNKx DJHg== 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 gh19si3316638ejb.526.2020.11.12.03.24.14; Thu, 12 Nov 2020 03:24:37 -0800 (PST) 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 S1728057AbgKLLWe (ORCPT + 99 others); Thu, 12 Nov 2020 06:22:34 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7177 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbgKLLWc (ORCPT ); Thu, 12 Nov 2020 06:22:32 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CWzhZ3Pj5z15VfX; Thu, 12 Nov 2020 19:22:06 +0800 (CST) Received: from compute.localdomain (10.175.112.70) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 12 Nov 2020 19:22:12 +0800 From: Zhang Changzhong To: , , , , , , CC: , Subject: [PATCH net] net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe() Date: Thu, 12 Nov 2020 19:23:59 +0800 Message-ID: <1605180239-1792-1-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.70] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the missing clk_disable_unprepare() before return from smsc_phy_probe() in the error handling case. Fixes: bedd8d78aba3 ("net: phy: smsc: LAN8710/20: add phy refclk in support") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/phy/smsc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index ec97669..0fc39ac 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -291,8 +291,10 @@ static int smsc_phy_probe(struct phy_device *phydev) return ret; ret = clk_set_rate(priv->refclk, 50 * 1000 * 1000); - if (ret) + if (ret) { + clk_disable_unprepare(priv->refclk); return ret; + } return 0; } -- 2.9.5