mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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]>
This commit is contained in:
1 parent
edd898181e
commit
14687619e1
1 file changed
+3
-1
+3
-1
@@ -2253,7 +2253,9 @@ void vm_unmap_ram(const void *mem, unsigned int count)
|
||||
}
|
||||
|
||||
va = find_unlink_vmap_area(addr);
|
||||
BUG_ON(!va);
|
||||
if (WARN_ON_ONCE(!va))
|
||||
return;
|
||||
|
||||
debug_check_no_locks_freed((void *)va->va_start,
|
||||
(va->va_end - va->va_start));
|
||||
free_unmap_vmap_area(va);
|
||||
|
||||
Reference in new issue
Block a user