Skip to content

Commit

Permalink
Smack: Use GFP_KERNEL for smack_parse_opts_str().
Browse files Browse the repository at this point in the history
Since smack_parse_opts_str() is calling match_strdup() which uses
GFP_KERNEL, it is safe to use GFP_KERNEL from kcalloc() which is
called by smack_parse_opts_str().

Signed-off-by: Tetsuo Handa <[email protected]>
Acked-by: Casey Schaufler <[email protected]>
  • Loading branch information
Tetsuo Handa authored and cschaufler committed Nov 14, 2016
1 parent 2e4939f commit 8c15d66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,12 @@ static int smack_parse_opts_str(char *options,
}
}

opts->mnt_opts = kcalloc(NUM_SMK_MNT_OPTS, sizeof(char *), GFP_ATOMIC);
opts->mnt_opts = kcalloc(NUM_SMK_MNT_OPTS, sizeof(char *), GFP_KERNEL);
if (!opts->mnt_opts)
goto out_err;

opts->mnt_opts_flags = kcalloc(NUM_SMK_MNT_OPTS, sizeof(int),
GFP_ATOMIC);
GFP_KERNEL);
if (!opts->mnt_opts_flags) {
kfree(opts->mnt_opts);
goto out_err;
Expand Down

0 comments on commit 8c15d66

Please sign in to comment.