diff options
author | Andrey Ryabinin <[email protected]> | 2018-10-26 15:07:07 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2018-10-26 16:26:33 -0700 |
commit | a8dda165ec34fac2b4119654330150e2c896e531 (patch) | |
tree | d681a7f38a1fa52f218da8428731cbe855ae7ac0 | |
parent | 3ca4ea3a7a78a243ee9edf71a2736bc8fb26d70f (diff) |
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]>
-rw-r--r-- | mm/vmalloc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index d00d42d6bf79..97d4b25d0373 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1587,6 +1587,8 @@ void vfree(const void *addr) kmemleak_free(addr); + might_sleep_if(!in_interrupt()); + if (!addr) return; if (unlikely(in_interrupt())) |