Skip to content

Commit

Permalink
apparmor: remove minimum size check for vmalloc()
Browse files Browse the repository at this point in the history
This is a follow-up to commit b5b3ee6 "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>
  • Loading branch information
Tetsuo Handa authored and John Johansen committed Aug 14, 2013
1 parent 9548906 commit dfe4ac2
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions security/apparmor/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ void *__aa_kvmalloc(size_t size, gfp_t flags)
if (size <= (16*PAGE_SIZE))
buffer = kmalloc(size, flags | GFP_NOIO | __GFP_NOWARN);
if (!buffer) {
/* see kvfree for why size must be at least work_struct size
* when allocated via vmalloc
*/
if (size < sizeof(struct work_struct))
size = sizeof(struct work_struct);
if (flags & __GFP_ZERO)
buffer = vzalloc(size);
else
Expand Down

0 comments on commit dfe4ac2

Please sign in to comment.