Merge tag 'nfsd-4.20' of git://linux-nfs.org/~bfields/linux
[linux-2.6-block.git] / mm / vmalloc.c
index a728fc4925573fe8235480782c22f580005d0167..97d4b25d0373102a197ba1de455a944cf7204061 100644 (file)
@@ -1577,6 +1577,8 @@ void vfree_atomic(const void *addr)
  *     have CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG, but making the calling
  *     conventions for vfree() arch-depenedent would be a really bad idea)
  *
+ *     May sleep if called *not* from interrupt context.
+ *
  *     NOTE: assumes that the object at @addr has a size >= sizeof(llist_node)
  */
 void vfree(const void *addr)
@@ -1585,6 +1587,8 @@ void vfree(const void *addr)
 
        kmemleak_free(addr);
 
+       might_sleep_if(!in_interrupt());
+
        if (!addr)
                return;
        if (unlikely(in_interrupt()))