From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B22A63B0AC2; Mon, 23 Mar 2026 13:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274313; cv=none; b=pyn8Gqc3LgZHZgsBoK1ZgEZ2IAlXS5Wy+6vrLlOGIYHflxTspYFNBfjwpFmFWL6jE4eOegpkE4iRGHPqRLStAX/Cstn962uRssM9vmvXrtmGVlZ+mNusa9yHMF/dV8l9stnZ/QK9JV/VAzA9+hjIa+WPYeW7HsOtgruUgSvDhdc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274313; c=relaxed/simple; bh=6eT2tRnDVziHV9vzk5uh1KK4YDOUY7Hk4vSwwNo7z4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FeMTkTFy0QlqjtEbZaR+lrOR4IbcxegFDTNazQLSAesMYzCwOUGlAYYST/4lzgrljU7asCBpwM4k4QLI49a947BqE0pdW/gbtZUiUca3ziy/JMeewRkm4aVBw5lpJpZqRp0fZ9UxFzQZIaEvEop/3OFORVWkX3KsrHq8z4Sn8gM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JFpzvFom; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JFpzvFom" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3598DC4CEF7; Mon, 23 Mar 2026 13:58:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774274313; bh=6eT2tRnDVziHV9vzk5uh1KK4YDOUY7Hk4vSwwNo7z4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JFpzvFom5qaS9y4E1a2q50vDIXBaZv1AFpPOQN+5DOi97HTKmY+4/clvCK9ZXdMDJ KiZ9iznuasb9AXgGDoWJ2Niwa1oOmyGa+ESFiUpD6OmcidJcLZlZ+pKvOMbMKPD4z2 eECucFym8IE1MjwodK7XXXH8KSqJHv855BeHZhcQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jonas Gorski , Florian Fainelli , Anas Iqbal , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.19 179/220] net: dsa: bcm_sf2: fix missing clk_disable_unprepare() in error paths Date: Mon, 23 Mar 2026 14:45:56 +0100 Message-ID: <20260323134510.231996245@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134504.575022936@linuxfoundation.org> References: <20260323134504.575022936@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anas Iqbal [ Upstream commit b48731849609cbd8c53785a48976850b443153fd ] Smatch reports: drivers/net/dsa/bcm_sf2.c:997 bcm_sf2_sw_resume() warn: 'priv->clk' from clk_prepare_enable() not released on lines: 983,990. The clock enabled by clk_prepare_enable() in bcm_sf2_sw_resume() is not released if bcm_sf2_sw_rst() or bcm_sf2_cfp_resume() fails. Add the missing clk_disable_unprepare() calls in the error paths to properly release the clock resource. Fixes: e9ec5c3bd238 ("net: dsa: bcm_sf2: request and handle clocks") Reviewed-by: Jonas Gorski Reviewed-by: Florian Fainelli Signed-off-by: Anas Iqbal Link: https://patch.msgid.link/20260318084212.1287-1-mohd.abd.6602@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/dsa/bcm_sf2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 960685596093b..de3efa3ce9a75 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -980,15 +980,19 @@ static int bcm_sf2_sw_resume(struct dsa_switch *ds) ret = bcm_sf2_sw_rst(priv); if (ret) { pr_err("%s: failed to software reset switch\n", __func__); + if (!priv->wol_ports_mask) + clk_disable_unprepare(priv->clk); return ret; } bcm_sf2_crossbar_setup(priv); ret = bcm_sf2_cfp_resume(ds); - if (ret) + if (ret) { + if (!priv->wol_ports_mask) + clk_disable_unprepare(priv->clk); return ret; - + } if (priv->hw_params.num_gphy == 1) bcm_sf2_gphy_enable_set(ds, true); -- 2.51.0