Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3930682pxj; Mon, 21 Jun 2021 09:36:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvaju/etub6BTB+McX6n0IiGagQv5vila2Fnn0HmGCTDdthHQwABJ7VhvXRnpbm2xumJHl X-Received: by 2002:a05:6602:2048:: with SMTP id z8mr20411274iod.91.1624293405766; Mon, 21 Jun 2021 09:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293405; cv=none; d=google.com; s=arc-20160816; b=rh00EukZHsNxQyTfQEbs6Kd5Km+UwxSU8y+QJS60roi7xOLf8zrsrFdlRkgVeTl8ec VADVvbhPweqO/mLsykF7ue/D1Hx2Q0dAs0fafoBRrbpP/7Aoph5kRI8CogwgHHSv1hK8 0htKlpAqpjvqgCENHTenzpv4ZVXoPW+YyevHs2AJUKEkIaBTHpk/JQR9lUAbgDB7eEM/ jILcrmL5ErT/yE06RBIp4kzdrKiyrIedL2MWRtuaIhM3LfOVBe/1fIbpOdywbEDReeIM doDvN74oLMCvzVgxr1sAcfVKNjC8EJpLYfZX4k8YAKjfx1jfCWlG844153PTuDw+TaHC JDQw== 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=1z6X4hblT4+VSOyw211/rgXs+7X10WzsYGhSYcot9FU=; b=pNEerKvjpDFZT9GxNhhQRObXHEjweCZtsSwUIguN69QlRwcP3FcvoELyIWBKC9Bm8b 4bGJFEbGrT/xvW35G06RWlGfecG0nNSfVKvpYceoBtNnBuexMjPTnybTQcdMYpESjQJW L/tJ5S0ur5vWSoTqQnWzfho/CnG/6qhii5qDXU08scV/twSWUca5cCx6ILM0w91gRYEE SPqiyve+zJoEQoCd15MFuPMRYWNGVQK6ge1R+1/yMoOliziYprecLB7cm5Jjri61dEf/ 7HEAhsvvsLjYN17rOkGF8G1c/Qn5vH/ekyY+ROuVDUz6sITeuJCpFAtq0mltmn7dZAof IkPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VaK6hJEp; 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 k24si21212309jan.49.2021.06.21.09.36.33; Mon, 21 Jun 2021 09:36:45 -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=VaK6hJEp; 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 S232905AbhFUQiQ (ORCPT + 99 others); Mon, 21 Jun 2021 12:38:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:55398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbhFUQeZ (ORCPT ); Mon, 21 Jun 2021 12:34:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1CE6C6141D; Mon, 21 Jun 2021 16:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292816; bh=BXJZ/x1tcx31DTwIbn9T1IdQBD1Jc7J7+yxVw4A22fE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VaK6hJEpGRsvh3NNHouMyML7kxYVoF37gqkMW7R9EglSJc0+gB3FtuI92ugV02nuP XkRaxURlvX3Ga/44F0s/Z1+uF6+I3ffcP6tJ7LF8RrYhgjbjftN/utBRSHFeBq8yKT NaVuPrIp2y0N89zXyTnEZX0FvisMDI2ENl9OLnNI= 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.10 141/146] net: stmmac: disable clocks in stmmac_remove_config_dt() Date: Mon, 21 Jun 2021 18:16:11 +0200 Message-Id: <20210621154920.550469220@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@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 @@ -626,6 +626,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); }