From: Danilo Krummrich Date: Thu, 25 Jul 2024 14:11:59 +0000 (+0200) Subject: mm: vrealloc: fix missing nommu implementation X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=012d84761204f5de84c6d92afea7468bbde1cd06;p=users%2Fjedix%2Flinux-maple.git mm: vrealloc: fix missing nommu implementation Commit 5ec6d992f460 ("mm: vmalloc: implement vrealloc()") introduces vrealloc(), but lacks the implementation of the nommu version of this function. Note that currently nommu isn't actually broken without this. The only user, kvrealloc(), never actually calls into vrealloc() with nommu, since it's guarded by is_vmalloc_addr(), which for nommu always returns false. However, since this becomes a real issue once vrealloc() is used by other code, fix this. Link: https://lkml.kernel.org/r/20240725141227.13954-1-dakr@kernel.org Fixes: 5ec6d992f460 ("mm: vmalloc: implement vrealloc()") Signed-off-by: Danilo Krummrich Signed-off-by: Andrew Morton --- diff --git a/mm/nommu.c b/mm/nommu.c index 7296e775e04e2..40cac1348b403 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -126,6 +126,11 @@ void *__vmalloc_noprof(unsigned long size, gfp_t gfp_mask) } EXPORT_SYMBOL(__vmalloc_noprof); +void *vrealloc_noprof(const void *p, size_t size, gfp_t flags) +{ + return krealloc_noprof(p, size, (flags | __GFP_COMP) & ~__GFP_HIGHMEM); +} + void *__vmalloc_node_range_noprof(unsigned long size, unsigned long align, unsigned long start, unsigned long end, gfp_t gfp_mask, pgprot_t prot, unsigned long vm_flags, int node,