diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 164951c47305..fc031d68327e 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -3049,3 +3049,18 @@ void print_vma_addr(char *prefix, unsigned long ip) | |||
3049 | } | 3049 | } |
3050 | up_read(¤t->mm->mmap_sem); | 3050 | up_read(¤t->mm->mmap_sem); |
3051 | } | 3051 | } |
3052 | |||
3053 | #ifdef CONFIG_PROVE_LOCKING | ||
3054 | void might_fault(void) | ||
3055 | { | ||
3056 | might_sleep(); | ||
3057 | /* | ||
3058 | * it would be nicer only to annotate paths which are not under | ||
3059 | * pagefault_disable, however that requires a larger audit and | ||
3060 | * providing helpers like get_user_atomic. | ||
3061 | */ | ||
3062 | if (!in_atomic() && current->mm) | ||
3063 | might_lock_read(¤t->mm->mmap_sem); | ||
3064 | } | ||
3065 | EXPORT_SYMBOL(might_fault); | ||
3066 | #endif | ||