Skip to contentSkip to conversation

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

PATCH In review Thomas Zimmermann 2 participants 2 messages Oct 17, 2025 – Oct 24, 2025

Subsystems (2)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/drm_gem_atomic_helper.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/drm_gem_atomic_helper.c +0 -2
index 6fb55601252f..569d41a65a0b 100644
@@ -338,8 +338,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);
Signature · 1 line
2.51.0