aboutsummaryrefslogtreecommitdiff
path: root/include/linux/security.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-26 09:21:05 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-26 09:21:05 +0100
commitc656d9ca48d3ef1a11449e892ce488ee0bb5a335 (patch)
tree0c5598659b3e7f12864d203967d42ac3feb1142c /include/linux/security.h
parent71ab6b245fda6e7597a667a67cce0d26c3c7a14b (diff)
parenta73ad3331fdbf4191cf99b83ea9ac7082b6757ba (diff)
Merge branch 'x86/fpu' into x86/cleanups
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index c13f1cec9ab..e3d4ecda267 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1818,17 +1818,21 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
static inline int security_vm_enough_memory(long pages)
{
+ WARN_ON(current->mm == NULL);
return cap_vm_enough_memory(current->mm, pages);
}
-static inline int security_vm_enough_memory_kern(long pages)
+static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
{
- return cap_vm_enough_memory(current->mm, pages);
+ WARN_ON(mm == NULL);
+ return cap_vm_enough_memory(mm, pages);
}
-static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
+static inline int security_vm_enough_memory_kern(long pages)
{
- return cap_vm_enough_memory(mm, pages);
+ /* If current->mm is a kernel thread then we will pass NULL,
+ for this specific case that is fine */
+ return cap_vm_enough_memory(current->mm, pages);
}
static inline int security_bprm_alloc(struct linux_binprm *bprm)