diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 20:02:53 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 20:02:53 +0200 |
commit | 39f1f78d53b9bcbca91967380c5f0f2305a5c55f (patch) | |
tree | 83020c0da45781d7b205193dd7327952133f2194 /mm | |
parent | posix_acl: handle NULL ACL in posix_acl_equiv_mode (diff) | |
download | linux-39f1f78d53b9bcbca91967380c5f0f2305a5c55f.tar.xz linux-39f1f78d53b9bcbca91967380c5f0f2305a5c55f.zip |
nick kvfree() from apparmor
too many places open-code it
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/util.c b/mm/util.c index f380af7ea779..d5ea733c5082 100644 --- a/mm/util.c +++ b/mm/util.c @@ -10,6 +10,7 @@ #include <linux/swapops.h> #include <linux/mman.h> #include <linux/hugetlb.h> +#include <linux/vmalloc.h> #include <asm/uaccess.h> @@ -387,6 +388,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; |