drm/sysfb: Do not dereference NULL pointer in plane reset
Subsystems (3)
Thomas Zimmermann
maintainerPATCH 1/1 drm/sysfb: Do not dereference NULL pointer in plane reset
The plane state in __drm_gem_reset_shadow_plane) can be NULL. Do not deref that pointer, but forward NULL to the other plane-reset helpers. Clears plane->state to NULL.
--- drivers/gpu/drm/drm_gem_atomic_helper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_gem_atomic_helper.c +6 -2
@@ -310,8 +310,12 @@ EXPORT_SYMBOL(drm_gem_destroy_shadow_plane_state);void __drm_gem_reset_shadow_plane (struct drm_plane *plane,struct drm_shadow_plane_state *shadow_plane_state) { -__drm_atomic_helper_plane_reset (plane, &shadow_plane_state->base); -drm_format_conv_state_init (&shadow_plane_state->fmtcnv_state); +if (shadow_plane_state) { +__drm_atomic_helper_plane_reset (plane, &shadow_plane_state->base); +drm_format_conv_state_init (&shadow_plane_state->fmtcnv_state); + }else { +__drm_atomic_helper_plane_reset (plane,NULL ); + } }EXPORT_SYMBOL (__drm_gem_reset_shadow_plane);
Signature · 1 line
2.51.0
Thomas Zimmermann <[email protected]> writes:
Hello Thomas,
Quoted 1 line
The plane state in
__drm_gem_reset_shadow_plane) can be NULL. Do not
That ) is off. I guess you meant either () or just the function name.
Quoted 15 lines
deref that pointer, but forward NULL to the other plane-reset helpers. Clears
plane->stateto NULL.Signed-off-by Thomas Zimmermann <[email protected]>Fixes b71565022031 ("drm/gem: Export implementation of shadow-plane helpers")Reported-by Dan Carpenter <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Melissa Wen <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc David Airlie <[email protected]>Cc Simona Vetter <[email protected]>Cc <[email protected]> # v5.15+
Quoted 4 lines
--- drivers/gpu/drm/drm_gem_atomic_helper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Thomas Zimmermann
maintainerHi
Am 24.10.25 um 11:16 schrieb Javier Martinez Canillas:
Quoted 6 lines
Thomas Zimmermann <[email protected]> writes:
Hello Thomas,
Quoted 1 line
The plane state in
__drm_gem_reset_shadow_plane) can be NULL. Do notThat ) is off. I guess you meant either () or just the function name.
Oh, indeed. I'll fix that when I land the patch.
Best regards
Thomas
Quoted 22 lines
Quoted 16 lines
deref that pointer, but forward NULL to the other plane-reset helpers. Clears
plane->stateto NULL.Signed-off-by Thomas Zimmermann <[email protected]>Fixes b71565022031 ("drm/gem: Export implementation of shadow-plane helpers")Reported-by Dan Carpenter <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Melissa Wen <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc David Airlie <[email protected]>Cc Simona Vetter <[email protected]>Cc <[email protected]> # v5.15+Quoted 4 lines
--- drivers/gpu/drm/drm_gem_atomic_helper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)Reviewed-by Javier Martinez Canillas <[email protected]>
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)