mm/vmalloc.c: return explicit error value in alloc_vmap_area()
authorBaoquan He <bhe@redhat.com>
Fri, 18 Apr 2025 22:36:53 +0000 (06:36 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 13 May 2025 06:50:32 +0000 (23:50 -0700)
commitb25f97d0f8043903a64e3a203b79219cc69f2f77
tree7826611236bb13050e9a791c644c5ba36414205a
parent8ab8442d44ee37cc21fdc11530158ee2b2be5ed5
mm/vmalloc.c: return explicit error value in alloc_vmap_area()

In codes of alloc_vmap_area(), it returns the upper bound 'vend' to
indicate if the allocation is successful or failed.  That is not very
clear.

Here change to return explicit error values and check them to judge if
allocation is successful.

Link: https://lkml.kernel.org/r/20250418223653.243436-6-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Shivank Garg <shivankg@amd.com>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmalloc.c