diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2013-05-06 03:10:35 +0100 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2013-05-12 21:31:02 +1000 |
commit | b5b3ee6c9cca8b6e1aa8c757e570f08f802c5573 (patch) | |
tree | 7c8d96e970311fcfdfd06f8bf8da1e8031c08434 /security/apparmor/lib.c | |
parent | bd71164abc141ea696014e3e23c561b0d7f1b434 (diff) | |
download | op-kernel-dev-b5b3ee6c9cca8b6e1aa8c757e570f08f802c5573.zip op-kernel-dev-b5b3ee6c9cca8b6e1aa8c757e570f08f802c5573.tar.gz |
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/apparmor/lib.c')
-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 d40bc592..fcfe023 100644 --- a/security/apparmor/lib.c +++ b/security/apparmor/lib.c @@ -111,19 +111,6 @@ void *__aa_kvmalloc(size_t size, gfp_t flags) } /** - * 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) * @@ -131,13 +118,8 @@ static void do_vfree(struct work_struct *work) */ 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 + if (is_vmalloc_addr(buffer)) + vfree(buffer); + else kfree(buffer); } |