Skip to content

Commit a8dda16

Browse files
aryabinintorvalds
authored andcommitted
vfree: add debug might_sleep()
Add might_sleep() call to vfree() to catch potential sleep-in-atomic bugs earlier. [[email protected]: drop might_sleep_if() from kvfree()] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andrey Ryabinin <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3ca4ea3 commit a8dda16

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mm/vmalloc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,6 +1587,8 @@ void vfree(const void *addr)
15871587

15881588
kmemleak_free(addr);
15891589

1590+
might_sleep_if(!in_interrupt());
1591+
15901592
if (!addr)
15911593
return;
15921594
if (unlikely(in_interrupt()))

0 commit comments

Comments
 (0)