drm/gem-atomic: Reset plane state to NULL if allocation failed

Unconditionally reset plane->state to NULL if the allocation of the
shadow plane state fails. Avoids an invalid address in the field.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patch.msgid.link/20251017091919.58770-1-tzimmermann@suse.de
This commit is contained in:
Thomas Zimmermann
2025-10-17 11:19:02 +02:00
parent 5a5e9c0228
commit 9837f9fcb7

View File

@@ -334,8 +334,6 @@ void drm_gem_reset_shadow_plane(struct drm_plane *plane)
}
shadow_plane_state = kzalloc(sizeof(*shadow_plane_state), GFP_KERNEL);
if (!shadow_plane_state)
return;
__drm_gem_reset_shadow_plane(plane, shadow_plane_state);
}
EXPORT_SYMBOL(drm_gem_reset_shadow_plane);