Skip to contentSkip to conversation

lib-test_hmm-remove-dead-null-checks-after-gfp_nofail-allocations.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: lib/test_hmm: remove dead NULL checks after GFP_NOFAIL allocations
has been removed from the -mm tree. Its filename was
lib-test_hmm-remove-dead-null-checks-after-gfp_nofail-allocations.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: lib/test_hmm: remove dead NULL checks after GFP_NOFAIL allocations
Date: Fri, 24 Jul 2026 10:28:50 +0800

kvcalloc with the __GFP_NOFAIL flag will never return NULL, so the subsequent NULL checks are unreachable dead code. Remove them.

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]>

---

 lib/test_hmm.c |    6 ------
 1 file changed, 6 deletions(-)
lib/test_hmm.c renamed from lib/test_hmm.c~lib-test_hmm-remove-dead-null-checks-after-gfp_nofail-allocations +0 -6
@@ -1312,16 +1312,10 @@ static int dmirror_migrate_to_device(str
 	if (!mmget_not_zero(mm))
 		return -EINVAL;
 
-	ret = -ENOMEM;
 	src_pfns = kvcalloc(PTRS_PER_PTE, sizeof(*src_pfns),
 			  GFP_KERNEL | __GFP_NOFAIL);
-	if (!src_pfns)
-		goto free_mem;
-
 	dst_pfns = kvcalloc(PTRS_PER_PTE, sizeof(*dst_pfns),
 			  GFP_KERNEL | __GFP_NOFAIL);
-	if (!dst_pfns)
-		goto free_mem;
 
 	ret = 0;
 	mmap_read_lock(mm);

_

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