Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E-EXK4 - Operating System Group
projects
Linux
Commits
39f1f78d
Commit
39f1f78d
authored
10 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
nick kvfree() from apparmor
too many places open-code it Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
50c6e282
Loading
Loading
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/linux/mm.h
+2
-0
2 additions, 0 deletions
include/linux/mm.h
mm/util.c
+10
-0
10 additions, 0 deletions
mm/util.c
security/apparmor/include/apparmor.h
+0
-1
0 additions, 1 deletion
security/apparmor/include/apparmor.h
security/apparmor/lib.c
+0
-14
0 additions, 14 deletions
security/apparmor/lib.c
with
12 additions
and
15 deletions
include/linux/mm.h
+
2
−
0
View file @
39f1f78d
...
...
@@ -370,6 +370,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
...
...
This diff is collapsed.
Click to expand it.
mm/util.c
+
10
−
0
View file @
39f1f78d
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
security/apparmor/include/apparmor.h
+
0
−
1
View file @
39f1f78d
...
...
@@ -66,7 +66,6 @@ extern int apparmor_initialized __initdata;
char
*
aa_split_fqname
(
char
*
args
,
char
**
ns_name
);
void
aa_info_message
(
const
char
*
str
);
void
*
__aa_kvmalloc
(
size_t
size
,
gfp_t
flags
);
void
kvfree
(
void
*
buffer
);
static
inline
void
*
kvmalloc
(
size_t
size
)
{
...
...
This diff is collapsed.
Click to expand it.
security/apparmor/lib.c
+
0
−
14
View file @
39f1f78d
...
...
@@ -104,17 +104,3 @@ void *__aa_kvmalloc(size_t size, gfp_t flags)
}
return
buffer
;
}
/**
* 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
))
vfree
(
buffer
);
else
kfree
(
buffer
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment