mm: collapse security_vm_enough_memory() variants into a single function
Collapse security_vm_enough_memory() variants into a single function. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
@@ -1563,6 +1563,8 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
|
||||
BUG_ON(!current->mm);
|
||||
|
||||
pathname = getname(specialfile);
|
||||
err = PTR_ERR(pathname);
|
||||
if (IS_ERR(pathname))
|
||||
@@ -1590,7 +1592,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
|
||||
spin_unlock(&swap_lock);
|
||||
goto out_dput;
|
||||
}
|
||||
if (!security_vm_enough_memory(p->pages))
|
||||
if (!security_vm_enough_memory_mm(current->mm, p->pages))
|
||||
vm_unacct_memory(p->pages);
|
||||
else {
|
||||
err = -ENOMEM;
|
||||
|
Reference in New Issue
Block a user