Skip to content

Commit

Permalink
vfree: add debug might_sleep()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
aryabinin authored and torvalds committed Oct 26, 2018
1 parent 3ca4ea3 commit a8dda16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,8 @@ void vfree(const void *addr)

kmemleak_free(addr);

might_sleep_if(!in_interrupt());

if (!addr)
return;
if (unlikely(in_interrupt()))
Expand Down

0 comments on commit a8dda16

Please sign in to comment.