[PATCH] drm/meson: Fix platform device reference leak in meson_encoder_hdmi_probe()
Wentao Liang
vulab at iscas.ac.cn
Wed Sep 16 10:48:39 PDT 2026
of_find_device_by_node() takes a reference on the HDMI transceiver
device, but the successful probe path never releases it; the reference
is only dropped when cec_notifier_conn_register() fails. The CEC
notifier keeps the device as a lookup key without taking a reference of
its own, so put the device right after the registration.
Fixes: 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
Cc: stable at vger.kernel.org
Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>
---
drivers/gpu/drm/meson/meson_encoder_hdmi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
index 1abb0572bb5f..8e727f0a7a8c 100644
--- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
@@ -472,6 +472,9 @@ int meson_encoder_hdmi_probe(struct meson_drm *priv)
}
meson_encoder_hdmi->cec_notifier = notifier;
+
+ /* The notifier keeps the device only as a lookup key */
+ put_device(&pdev->dev);
}
priv->encoders[MESON_ENC_HDMI] = meson_encoder_hdmi;
--
2.34.1
More information about the linux-amlogic
mailing list