summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-05-06 14:02:53 -0400
committerChanho Park <chanho61.park@samsung.com>2016-01-07 21:48:11 +0900
commitcdaffdcb49879fbbda590375bafa0a03d137dbc8 (patch)
tree3bddc9e92896bc38d05daecb3c2c6079cb77beb1 /mm
parent964b443e73fb8a1ab3c8946aae564ceeaf8773ba (diff)
downloadlinux-3.10-artik-cdaffdcb49879fbbda590375bafa0a03d137dbc8.tar.gz
linux-3.10-artik-cdaffdcb49879fbbda590375bafa0a03d137dbc8.tar.bz2
linux-3.10-artik-cdaffdcb49879fbbda590375bafa0a03d137dbc8.zip
nick kvfree() from apparmor
too many places open-code it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Conflicts: mm/util.c security/apparmor/include/apparmor.h security/apparmor/lib.c Change-Id: Id868c19eac60d3749f36d18a201d38892dd2119c
Diffstat (limited to 'mm')
-rw-r--r--mm/util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/util.c b/mm/util.c
index 0b1725254ff..6186c32b810 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -7,6 +7,8 @@
#include <linux/security.h>
#include <linux/swap.h>
#include <linux/swapops.h>
+#include <linux/vmalloc.h>
+
#include <asm/uaccess.h>
#include "internal.h"
@@ -381,6 +383,15 @@ unsigned long vm_mmap(struct file *file, unsigned long addr,
}
EXPORT_SYMBOL(vm_mmap);
+void kvfree(const void *addr)
+{
+ if (is_vmalloc_addr(addr))
+ vfree(addr);
+ else
+ kfree(addr);
+}
+EXPORT_SYMBOL(kvfree);
+
struct address_space *page_mapping(struct page *page)
{
struct address_space *mapping = page->mapping;