Skip to contentSkip to conversation

drm-remove-dead-warn_on-null-check-after-gfp_nofail-allocation.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Aug 4

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: drm: remove dead WARN_ON NULL check after GFP_NOFAIL allocation
has been removed from the -mm tree. Its filename was
drm-remove-dead-warn_on-null-check-after-gfp_nofail-allocation.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Gou Hao <[email protected]>
Subject: drm: remove dead WARN_ON NULL check after GFP_NOFAIL allocation
Date: Fri, 24 Jul 2026 10:28:49 +0800

kzalloc_obj with the __GFP_NOFAIL flag will never return NULL, so the subsequent WARN_ON(!ctx) is unreachable dead code. Remove it.

Cc Bharat Potnuri <[email protected]>
Cc Cédric Le Goater <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc jiazhenyuan <[email protected]>
Cc Leon Romanovsky <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nam Cao <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Nilay Shroff <[email protected]>
Cc Shrikanth Hegde <[email protected]>
Cc Thomas Zimemrmann <[email protected]>
Cc Wentao Guan <[email protected]>
Cc Alistair Popple <[email protected]>

---

 drivers/gpu/drm/drm_modeset_lock.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/drm_modeset_lock.c renamed from drivers/gpu/drm/drm_modeset_lock.c~drm-remove-dead-warn_on-null-check-after-gfp_nofail-allocation +0 -4
@@ -149,11 +149,7 @@ void drm_modeset_lock_all(struct drm_dev
 	int ret;
 
 	ctx = kzalloc_obj(*ctx, GFP_KERNEL | __GFP_NOFAIL);
-	if (WARN_ON(!ctx))
-		return;
-
 	mutex_lock(&config->mutex);
-
 	drm_modeset_acquire_init(ctx, 0);
 
 retry:

_

Patches currently in -mm which might be from [email protected] are