aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-05-06 14:02:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 14:02:53 -0400
commit39f1f78d53b9bcbca91967380c5f0f2305a5c55f (patch)
tree83020c0da45781d7b205193dd7327952133f2194 /mm
parent50c6e282bdf5e8dabf8d7cf7b162545a55645fd9 (diff)
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.c10
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 @@
10#include <linux/swapops.h> 10#include <linux/swapops.h>
11#include <linux/mman.h> 11#include <linux/mman.h>
12#include <linux/hugetlb.h> 12#include <linux/hugetlb.h>
13#include <linux/vmalloc.h>
13 14
14#include <asm/uaccess.h> 15#include <asm/uaccess.h>
15 16
@@ -387,6 +388,15 @@ unsigned long vm_mmap(struct file *file, unsigned long addr,
387} 388}
388EXPORT_SYMBOL(vm_mmap); 389EXPORT_SYMBOL(vm_mmap);
389 390
391void kvfree(const void *addr)
392{
393 if (is_vmalloc_addr(addr))
394 vfree(addr);
395 else
396 kfree(addr);
397}
398EXPORT_SYMBOL(kvfree);
399
390struct address_space *page_mapping(struct page *page) 400struct address_space *page_mapping(struct page *page)
391{ 401{
392 struct address_space *mapping = page->mapping; 402 struct address_space *mapping = page->mapping;