[PATCH] drm/rockchip: dw_hdmi: Fix hdmiphy_clk reference leak in dw_hdmi_rockchip_bind()

Wentao Liang vulab at iscas.ac.cn
Wed Sep 16 11:17:13 PDT 2026


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 at vger.kernel.org
Signed-off-by: Wentao Liang <vulab at 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




More information about the linux-arm-kernel mailing list