diff options
| author | 2026-10-05 03:38:07 +0300 | |
|---|---|---|
| committer | 2026-10-12 18:01:51 +0200 | |
| commit | b6e19848c9db535d81d6db85c7cc1324e6611791 (patch) | |
| tree | 4ae1a6ed85a64ac06f441201bfb41905c3dc0716 /scripts/Makefile.thinlto | |
| parent | drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper (diff) | |
drm/rockchip: dw_hdmi_qp: Fix invalid drvdata access in PM ops
The system-sleep PM callbacks fetch the driver state via
dev_get_drvdata() and dereference it unconditionally. However, the
platform device is bound by ->probe(), which merely registers a
component, hence the callbacks may well run when no valid state is
available:
- Before the aggregate driver calls ->bind(), e.g. when the system
suspends while probing is still deferred waiting for the VOP,
dev_get_drvdata() returns NULL.
- After ->unbind(), or when ->bind() fails past platform_set_drvdata(),
drvdata is left pointing to memory obtained via drmm_kzalloc(), which
is released together with the DRM device, while this platform device
remains bound and PM-capable.
Publish the driver data only after ->bind() completes successfully, and
clear it in ->unbind(). This ensures that a non-NULL drvdata always
represents live state, allowing each PM callback to rely on a single
NULL check.
Fixes: 128a9bf8ace2 ("drm/rockchip: Add basic RK3588 HDMI output support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260702151550.8E14D1F000E9@smtp.kernel.org/
Closes: https://lore.kernel.org/all/20260723014811.1F9F01F000E9@smtp.kernel.org/
Tested-by: Robin Räber <robin.raebi@gmail.com>
Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-6-195157ba0b40@collabora.com
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
