Message ID | 201703281907.EDE73998.FOOFVJFMQLHtSO@I-love.SAKURA.ne.jp (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/mm/util.c b/mm/util.c index 656dc5e..2a2ef72 100644 --- a/mm/util.c +++ b/mm/util.c @@ -331,6 +331,12 @@ unsigned long vm_mmap(struct file *file, unsigned long addr, void kvfree(const void *addr) { + /* Detect errors before kvmalloc() falls back to vmalloc(). */ + if (addr) { + WARN_ON(in_nmi()); + if (likely(!in_interrupt())) + might_sleep(); + } if (is_vmalloc_addr(addr)) vfree(addr); else