1 From b5b3ee6c9cca8b6e1aa8c757e570f08f802c5573 Mon Sep 17 00:00:00 2001
2 From: Al Viro <viro@ZenIV.linux.org.uk>
3 Date: Mon, 6 May 2013 03:10:35 +0100
4 Subject: apparmor: no need to delay vfree()
6 vfree() can be called from interrupt contexts now
8 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 Acked-by: John Johansen <john.johansen@canonical.com>
10 Signed-off-by: James Morris <james.l.morris@oracle.com>
12 diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c
13 index d40bc59..fcfe023 100644
14 --- a/security/apparmor/lib.c
15 +++ b/security/apparmor/lib.c
16 @@ -111,19 +111,6 @@ void *__aa_kvmalloc(size_t size, gfp_t flags)
20 - * do_vfree - workqueue routine for freeing vmalloced memory
21 - * @work: data to be freed
23 - * The work_struct is overlaid to the data being freed, as at the point
24 - * the work is scheduled the data is no longer valid, be its freeing
25 - * needs to be delayed until safe.
27 -static void do_vfree(struct work_struct *work)
33 * kvfree - free an allocation do by kvmalloc
34 * @buffer: buffer to free (MAYBE_NULL)
36 @@ -131,13 +118,8 @@ static void do_vfree(struct work_struct *work)
38 void kvfree(void *buffer)
40 - if (is_vmalloc_addr(buffer)) {
41 - /* Data is no longer valid so just use the allocated space
42 - * as the work_struct
44 - struct work_struct *work = (struct work_struct *) buffer;
45 - INIT_WORK(work, do_vfree);
46 - schedule_work(work);
48 + if (is_vmalloc_addr(buffer))