Skip to content

Commit 1468761

Browse files
urezkiakpm00
authored andcommitted
mm: vmalloc: replace BUG_ON() by WARN_ON_ONCE()
Currently a vm_unmap_ram() functions triggers a BUG() if an area is not found. Replace it by the WARN_ON_ONCE() error message and keep machine alive instead of stopping it. The worst case is a memory leaking. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Uladzislau Rezki (Sony) <[email protected]> Reviewed-by: Lorenzo Stoakes <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Cc: Baoquan He <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Oleksiy Avramchenko <[email protected]> Cc: Roman Gushchin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent edd8981 commit 1468761

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mm/vmalloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2253,7 +2253,9 @@ void vm_unmap_ram(const void *mem, unsigned int count)
22532253
}
22542254

22552255
va = find_unlink_vmap_area(addr);
2256-
BUG_ON(!va);
2256+
if (WARN_ON_ONCE(!va))
2257+
return;
2258+
22572259
debug_check_no_locks_freed((void *)va->va_start,
22582260
(va->va_end - va->va_start));
22592261
free_unmap_vmap_area(va);

0 commit comments

Comments
 (0)