diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2013-05-05 22:10:35 -0400 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2013-05-12 07:31:02 -0400 |
commit | b5b3ee6c9cca8b6e1aa8c757e570f08f802c5573 (patch) | |
tree | 7c8d96e970311fcfdfd06f8bf8da1e8031c08434 /security | |
parent | bd71164abc141ea696014e3e23c561b0d7f1b434 (diff) |
apparmor: no need to delay vfree()
vfree() can be called from interrupt contexts now
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/apparmor/lib.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c index d40bc592180d..fcfe0233574c 100644 --- a/security/apparmor/lib.c +++ b/security/apparmor/lib.c | |||
@@ -111,19 +111,6 @@ void *__aa_kvmalloc(size_t size, gfp_t flags) | |||
111 | } | 111 | } |
112 | 112 | ||
113 | /** | 113 | /** |
114 | * do_vfree - workqueue routine for freeing vmalloced memory | ||
115 | * @work: data to be freed | ||
116 | * | ||
117 | * The work_struct is overlaid to the data being freed, as at the point | ||
118 | * the work is scheduled the data is no longer valid, be its freeing | ||
119 | * needs to be delayed until safe. | ||
120 | */ | ||
121 | static void do_vfree(struct work_struct *work) | ||
122 | { | ||
123 | vfree(work); | ||
124 | } | ||
125 | |||
126 | /** | ||
127 | * kvfree - free an allocation do by kvmalloc | 114 | * kvfree - free an allocation do by kvmalloc |
128 | * @buffer: buffer to free (MAYBE_NULL) | 115 | * @buffer: buffer to free (MAYBE_NULL) |
129 | * | 116 | * |
@@ -131,13 +118,8 @@ static void do_vfree(struct work_struct *work) | |||
131 | */ | 118 | */ |
132 | void kvfree(void *buffer) | 119 | void kvfree(void *buffer) |
133 | { | 120 | { |
134 | if (is_vmalloc_addr(buffer)) { | 121 | if (is_vmalloc_addr(buffer)) |
135 | /* Data is no longer valid so just use the allocated space | 122 | vfree(buffer); |
136 | * as the work_struct | 123 | else |
137 | */ | ||
138 | struct work_struct *work = (struct work_struct *) buffer; | ||
139 | INIT_WORK(work, do_vfree); | ||
140 | schedule_work(work); | ||
141 | } else | ||
142 | kfree(buffer); | 124 | kfree(buffer); |
143 | } | 125 | } |