diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 14:02:53 -0400 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-04-27 19:59:54 +0200 |
commit | fb6a2a8ebe2741cd15d9f4c613c6b40cf0e40ea5 (patch) | |
tree | 6a12ea3bc00a1298785a998b07b060c846512196 /mm | |
parent | 75f208f5585ea8ccd430521355eb7bc6f7775a73 (diff) | |
download | lwn-fb6a2a8ebe2741cd15d9f4c613c6b40cf0e40ea5.tar.gz lwn-fb6a2a8ebe2741cd15d9f4c613c6b40cf0e40ea5.zip |
nick kvfree() from apparmor
commit 39f1f78d53b9bcbca91967380c5f0f2305a5c55f upstream.
too many places open-code it
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
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 de943ec0a4c8..18fd704c1a19 100644 --- a/mm/util.c +++ b/mm/util.c @@ -7,6 +7,7 @@ #include <linux/security.h> #include <linux/swap.h> #include <linux/swapops.h> +#include <linux/vmalloc.h> #include <asm/uaccess.h> #include "internal.h" @@ -380,6 +381,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; |