Skip to content

Commit afad535

Browse files
Dan Carpenterjrjohansen
authored andcommitted
apparmor: use passed in gfp flags in aa_alloc_null()
These allocations should use the gfp flags from the caller instead of GFP_KERNEL. But from what I can see, all the callers pass in GFP_KERNEL so this does not affect runtime. Fixes: e31dd6e ("apparmor: fix: kzalloc perms tables for shared dfas") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent 180cf25 commit afad535

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

security/apparmor/policy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,12 @@ struct aa_profile *aa_alloc_null(struct aa_profile *parent, const char *name,
589589
profile->label.flags |= FLAG_NULL;
590590
rules = list_first_entry(&profile->rules, typeof(*rules), list);
591591
rules->file.dfa = aa_get_dfa(nulldfa);
592-
rules->file.perms = kcalloc(2, sizeof(struct aa_perms), GFP_KERNEL);
592+
rules->file.perms = kcalloc(2, sizeof(struct aa_perms), gfp);
593593
if (!rules->file.perms)
594594
goto fail;
595595
rules->file.size = 2;
596596
rules->policy.dfa = aa_get_dfa(nulldfa);
597-
rules->policy.perms = kcalloc(2, sizeof(struct aa_perms), GFP_KERNEL);
597+
rules->policy.perms = kcalloc(2, sizeof(struct aa_perms), gfp);
598598
if (!rules->policy.perms)
599599
goto fail;
600600
rules->policy.size = 2;

0 commit comments

Comments
 (0)