Loading include/linux/mm.h +2 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,8 @@ static inline int is_vmalloc_or_module_addr(const void *x) } #endif extern void kvfree(const void *addr); static inline void compound_lock(struct page *page) { #ifdef CONFIG_TRANSPARENT_HUGEPAGE Loading mm/util.c +10 −0 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -383,6 +384,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; Loading security/apparmor/include/apparmor.h +0 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ extern int apparmor_initialized __initdata; char *aa_split_fqname(char *args, char **ns_name); void aa_info_message(const char *str); void *kvmalloc(size_t size); void kvfree(void *buffer); /** Loading security/apparmor/lib.c +0 −31 Original line number Diff line number Diff line Loading @@ -104,34 +104,3 @@ void *kvmalloc(size_t size) return buffer; } /** * do_vfree - workqueue routine for freeing vmalloced memory * @work: data to be freed * * The work_struct is overlaid to the data being freed, as at the point * the work is scheduled the data is no longer valid, be its freeing * needs to be delayed until safe. */ static void do_vfree(struct work_struct *work) { vfree(work); } /** * kvfree - free an allocation do by kvmalloc * @buffer: buffer to free (MAYBE_NULL) * * Free a buffer allocated by kvmalloc */ void kvfree(void *buffer) { if (is_vmalloc_addr(buffer)) { /* Data is no longer valid so just use the allocated space * as the work_struct */ struct work_struct *work = (struct work_struct *) buffer; INIT_WORK(work, do_vfree); schedule_work(work); } else kfree(buffer); } Loading
include/linux/mm.h +2 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,8 @@ static inline int is_vmalloc_or_module_addr(const void *x) } #endif extern void kvfree(const void *addr); static inline void compound_lock(struct page *page) { #ifdef CONFIG_TRANSPARENT_HUGEPAGE Loading
mm/util.c +10 −0 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -383,6 +384,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; Loading
security/apparmor/include/apparmor.h +0 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ extern int apparmor_initialized __initdata; char *aa_split_fqname(char *args, char **ns_name); void aa_info_message(const char *str); void *kvmalloc(size_t size); void kvfree(void *buffer); /** Loading
security/apparmor/lib.c +0 −31 Original line number Diff line number Diff line Loading @@ -104,34 +104,3 @@ void *kvmalloc(size_t size) return buffer; } /** * do_vfree - workqueue routine for freeing vmalloced memory * @work: data to be freed * * The work_struct is overlaid to the data being freed, as at the point * the work is scheduled the data is no longer valid, be its freeing * needs to be delayed until safe. */ static void do_vfree(struct work_struct *work) { vfree(work); } /** * kvfree - free an allocation do by kvmalloc * @buffer: buffer to free (MAYBE_NULL) * * Free a buffer allocated by kvmalloc */ void kvfree(void *buffer) { if (is_vmalloc_addr(buffer)) { /* Data is no longer valid so just use the allocated space * as the work_struct */ struct work_struct *work = (struct work_struct *) buffer; INIT_WORK(work, do_vfree); schedule_work(work); } else kfree(buffer); }