Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3922027pxj; Mon, 21 Jun 2021 09:25:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAHXzYJDSGp0Nb9gPsRjHRmLlDhgMLy1F0AYGlVLp7pF5UT5uFgIfE5+NbUKH35KrCE/DX X-Received: by 2002:aa7:c4d0:: with SMTP id p16mr23126034edr.150.1624292751472; Mon, 21 Jun 2021 09:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292751; cv=none; d=google.com; s=arc-20160816; b=OGjb0u2ZTWnjRDhDKyBlKyo7lowsIpKy8cmNLkPn6lSbGCcEHBOAC0DBvJXhH0+Bk1 yqAilgklIvevtt41qb2PHlVbKLDFSg/ogXLGBxmp4zXLx0U7zP16k63/A0V063iy75W3 3t2qShLInJgEStY3WZsRDgsdrof0vcz3CSDeLT3rhw0FUQ2YB/pr+YAdYJOm8UCUEpKb EYOhPO8io9GVHq7P8Cyz6ISKlPnV9kljs9ijbUKI3tf3su5Ujb1n9ejQyVzprdoff9r1 wN2S189OlRMpYLC3o0L1CiwESFBQpo0uufUzlqZtuVGn6gXTSgkMUjjXbcrtTquLqE8a lLkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Dsrk3oM0J4NPrwQN73DNQR89wZimzlgCnbSMwLmP15I=; b=Rc5eqtwZ7WSH7xySv58g0UvdEgVugfBsqZHgxNqh2Q3g6Rg99XS6AsSbLuKMg5SjFt opNIePecn4+lXKd5gmtigKrLuaP/Ojv4yYDMGsvrBvWYnv6Yn4ahcoUbJS0a/MWeF3rg qpvuxiiAguTrMWoIVp7mimCizSMRI9K9Tvo0AL9KyjeLgjmmaBReuh1zy5DLHRZr31u/ XCTVpv9+DfnrBpxT0p56Chhie27I+0fOmvM8B9C9G9o2rwsGS/gSonwZji+CsRvK4+6I BXsWX3SV0iDWRX6yqX8P2+9+vuMXyu6x7xjiB/KfJrmeGAsI9o9EHywWzQqODZThv5w4 fggA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g587XQyM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la20si12830842ejc.3.2021.06.21.09.25.28; Mon, 21 Jun 2021 09:25:51 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g587XQyM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231621AbhFUQYQ (ORCPT + 99 others); Mon, 21 Jun 2021 12:24:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:42656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbhFUQWh (ORCPT ); Mon, 21 Jun 2021 12:22:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 96ACB61357; Mon, 21 Jun 2021 16:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292410; bh=oiuZW9IPZl6NaQmo9Os/WDu54p3gtkTZ+P7cPUjxn8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g587XQyMW2vwJuXiuxwoctDCVkLK8+D0R4vdaiqcx9I1xjPI4xq6djD+23DX8lsi0 dhqzfv6mN81v07aVz4fTG7SlCq/Bm8OqwIr64qZA8nzmSldfqdD6P2yAHcLHvGLDy6 LhJ9gw6j87iV99hrMgEO4+99wOH+y9vhEyKe90CY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joakim Zhang , "David S. Miller" Subject: [PATCH 5.4 81/90] net: stmmac: disable clocks in stmmac_remove_config_dt() Date: Mon, 21 Jun 2021 18:15:56 +0200 Message-Id: <20210621154906.891367695@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154904.159672728@linuxfoundation.org> References: <20210621154904.159672728@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joakim Zhang commit 8f269102baf788aecfcbbc6313b6bceb54c9b990 upstream. Platform drivers may call stmmac_probe_config_dt() to parse dt, could call stmmac_remove_config_dt() in error handing after dt parsed, so need disable clocks in stmmac_remove_config_dt(). Go through all platforms drivers which use stmmac_probe_config_dt(), none of them disable clocks manually, so it's safe to disable them in stmmac_remove_config_dt(). Fixes: commit d2ed0a7755fe ("net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks") Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -624,6 +624,8 @@ error_pclk_get: void stmmac_remove_config_dt(struct platform_device *pdev, struct plat_stmmacenet_data *plat) { + clk_disable_unprepare(plat->stmmac_clk); + clk_disable_unprepare(plat->pclk); of_node_put(plat->phy_node); of_node_put(plat->mdio_node); }