Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/rockchip: dw_hdmi: Fix hdmiphy_clk reference leak in dw_hdmi_rockchip_bind()
@ 2026-09-16 18:17 Wentao Liang
  0 siblings, 0 replies; only message in thread
From: Wentao Liang @ 2026-09-16 18:17 UTC (permalink / raw)
  To: airlied
  Cc: andy.yan, dri-devel, heiko, hjc, jonas, linux-arm-kernel,
	linux-kernel, linux-rockchip, maarten.lankhorst, mripard, simona,
	tzimmermann, Wentao Liang, stable

The reference to the HDMI PHY clock obtained with
of_clk_get_from_provider() is never released, neither when binding
fails nor when the component is unbound.  Drop it on both paths.

Fixes: 3303a206ae74 ("drm/rockchip: dw_hdmi: Filter modes based on hdmiphy_clk")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 0dc1eb5d2ae3..5b90de4da5a9 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -622,6 +622,8 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 	return 0;
 
 err_bind:
+	if (hdmi->hdmiphy_clk)
+		clk_put(hdmi->hdmiphy_clk);
 	drm_encoder_cleanup(encoder);
 
 	return ret;
@@ -632,6 +634,8 @@ static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,
 {
 	struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
 
+	if (hdmi->hdmiphy_clk)
+		clk_put(hdmi->hdmiphy_clk);
 	dw_hdmi_unbind(hdmi->hdmi);
 	drm_encoder_cleanup(&hdmi->encoder.encoder);
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-16 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 18:17 [PATCH] drm/rockchip: dw_hdmi: Fix hdmiphy_clk reference leak in dw_hdmi_rockchip_bind() Wentao Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox