Skip to content
Commit 0eef1dcb authored by Samuel Holland's avatar Samuel Holland Committed by Greg Kroah-Hartman
Browse files

drm/sun4i: Fix crash during suspend after component bind failure



[ Upstream commit 1342b5b2 ]

If the component driver fails to bind, or is unbound, the driver data
for the top-level platform device points to a freed drm_device. If the
system is then suspended, the driver passes this dangling pointer to
drm_mode_config_helper_suspend(), which crashes.

Fix this by only setting the driver data while the platform driver holds
a reference to the drm_device.

Fixes: 624b4b48 ("drm: sun4i: Add support for suspending the display driver")
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
Reviewed-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220615054254.16352-1-samuel@sholland.org


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b0360743
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment