diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2013-06-17 08:25:08 -0400 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2013-08-14 14:42:05 -0400 |
commit | dfe4ac28be73833556756dca6771d4274a7f1157 (patch) | |
tree | fe7fb72a5232482e326c0437a183f96d2bac3c75 | |
parent | 9548906b2bb7ff09e12c013a55d669bef2c8e121 (diff) |
apparmor: remove minimum size check for vmalloc()
This is a follow-up to commit b5b3ee6c "apparmor: no need to delay vfree()".
Since vmalloc() will do "size = PAGE_ALIGN(size);",
we don't need to check for "size >= sizeof(struct work_struct)".
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: John Johansen <john.johansen@canonical.com>
-rw-r--r-- | security/apparmor/lib.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c index fcfe0233574c..69689922c491 100644 --- a/security/apparmor/lib.c +++ b/security/apparmor/lib.c | |||
@@ -97,11 +97,6 @@ void *__aa_kvmalloc(size_t size, gfp_t flags) | |||
97 | if (size <= (16*PAGE_SIZE)) | 97 | if (size <= (16*PAGE_SIZE)) |
98 | buffer = kmalloc(size, flags | GFP_NOIO | __GFP_NOWARN); | 98 | buffer = kmalloc(size, flags | GFP_NOIO | __GFP_NOWARN); |
99 | if (!buffer) { | 99 | if (!buffer) { |
100 | /* see kvfree for why size must be at least work_struct size | ||
101 | * when allocated via vmalloc | ||
102 | */ | ||
103 | if (size < sizeof(struct work_struct)) | ||
104 | size = sizeof(struct work_struct); | ||
105 | if (flags & __GFP_ZERO) | 100 | if (flags & __GFP_ZERO) |
106 | buffer = vzalloc(size); | 101 | buffer = vzalloc(size); |
107 | else | 102 | else |