Skip to content

Commit

Permalink
shmem_parse_options(): don't bother with mpol in separate variable
Browse files Browse the repository at this point in the history
just use ctx->mpol (note that callers always set ctx->mpol to NULL when
calling that).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Sep 13, 2019
1 parent 0b5071d commit f6490b7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3366,7 +3366,6 @@ static const struct export_operations shmem_export_ops = {
static int shmem_parse_options(char *options, struct shmem_options *ctx)
{
char *this_char, *value, *rest;
struct mempolicy *mpol = NULL;
uid_t uid;
gid_t gid;

Expand Down Expand Up @@ -3452,24 +3451,24 @@ static int shmem_parse_options(char *options, struct shmem_options *ctx)
#endif
#ifdef CONFIG_NUMA
} else if (!strcmp(this_char,"mpol")) {
mpol_put(mpol);
mpol = NULL;
if (mpol_parse_str(value, &mpol))
mpol_put(ctx->mpol);
ctx->mpol = NULL;
if (mpol_parse_str(value, &ctx->mpol))
goto bad_val;
#endif
} else {
pr_err("tmpfs: Bad mount option %s\n", this_char);
goto error;
}
}
ctx->mpol = mpol;
return 0;

bad_val:
pr_err("tmpfs: Bad value '%s' for mount option '%s'\n",
value, this_char);
error:
mpol_put(mpol);
mpol_put(ctx->mpol);
ctx->mpol = NULL;
return 1;

}
Expand Down

0 comments on commit f6490b7

Please sign in to comment.