Skip to contentSkip to conversation

mm-vmalloc-fix-incorrect-size-reporting-on-allocation-failure.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 24

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/vmalloc: fix incorrect size reporting on allocation failure
has been removed from the -mm tree. Its filename was
mm-vmalloc-fix-incorrect-size-reporting-on-allocation-failure.patch

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

------------------------------------------------------
From: "Uladzislau Rezki (Sony)" <[email protected]>
Subject: mm/vmalloc: fix incorrect size reporting on allocation failure
Date: Mon, 2 Mar 2026 12:47:39 +0100

When __vmalloc_area_node() fails to allocate pages, the failure message may report an incorrect allocation size, for example:

vmalloc error: size 0, failed to allocate pages, ...

This happens because the warning prints area->nr_pages * PAGE_SIZE. At this point, area->nr_pages may be zero or partly populated thus it is not valid.

Report the originally requested allocation size instead by using nr_small_pages * PAGE_SIZE, which reflects the actual number of pages being requested by user.

---

 mm/vmalloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmalloc.c renamed from mm/vmalloc.c~mm-vmalloc-fix-incorrect-size-reporting-on-allocation-failure +1 -1
@@ -3894,7 +3894,7 @@ static void *__vmalloc_area_node(struct
 		if (!fatal_signal_pending(current) && page_order == 0)
 			warn_alloc(gfp_mask, NULL,
 				"vmalloc error: size %lu, failed to allocate pages",
-				area->nr_pages * PAGE_SIZE);
+				nr_small_pages * PAGE_SIZE);
 		goto fail;
 	}
 

_

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