]>
Commit | Line | Data |
---|---|---|
37e96ed9 DM |
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() | |
5 | ||
6 | vfree() can be called from interrupt contexts now | |
7 | ||
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> | |
11 | ||
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) | |
17 | } | |
18 | ||
19 | /** | |
20 | - * do_vfree - workqueue routine for freeing vmalloced memory | |
21 | - * @work: data to be freed | |
22 | - * | |
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. | |
26 | - */ | |
27 | -static void do_vfree(struct work_struct *work) | |
28 | -{ | |
29 | - vfree(work); | |
30 | -} | |
31 | - | |
32 | -/** | |
33 | * kvfree - free an allocation do by kvmalloc | |
34 | * @buffer: buffer to free (MAYBE_NULL) | |
35 | * | |
36 | @@ -131,13 +118,8 @@ static void do_vfree(struct work_struct *work) | |
37 | */ | |
38 | void kvfree(void *buffer) | |
39 | { | |
40 | - if (is_vmalloc_addr(buffer)) { | |
41 | - /* Data is no longer valid so just use the allocated space | |
42 | - * as the work_struct | |
43 | - */ | |
44 | - struct work_struct *work = (struct work_struct *) buffer; | |
45 | - INIT_WORK(work, do_vfree); | |
46 | - schedule_work(work); | |
47 | - } else | |
48 | + if (is_vmalloc_addr(buffer)) | |
49 | + vfree(buffer); | |
50 | + else | |
51 | kfree(buffer); | |
52 | } | |
53 | -- | |
54 | cgit v0.10.2 | |
55 |