Skip to content

Commit 9837f9f

Browse files
committed
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
1 parent 5a5e9c0 commit 9837f9f

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

drivers/gpu/drm/drm_gem_atomic_helper.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,6 @@ void drm_gem_reset_shadow_plane(struct drm_plane *plane)
334334
}
335335

336336
shadow_plane_state = kzalloc(sizeof(*shadow_plane_state), GFP_KERNEL);
337-
if (!shadow_plane_state)
338-
return;
339337
__drm_gem_reset_shadow_plane(plane, shadow_plane_state);
340338
}
341339
EXPORT_SYMBOL(drm_gem_reset_shadow_plane);

0 commit comments

Comments
 (0)