Skip to content

Commit

Permalink
9p v9fs_parse_options: replace simple_strtoul with kstrtouint
Browse files Browse the repository at this point in the history
This is also a checkpatch change, but this one might have more implications
so keeping this separate

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Dominique Martinet <[email protected]>
  • Loading branch information
martinetd committed Nov 3, 2021
1 parent 024b7d6 commit 10c69a0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fs/9p/v9fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
substring_t args[MAX_OPT_ARGS];
char *p;
int option = 0;
char *s, *e;
char *s;
int ret = 0;

/* setup defaults */
Expand Down Expand Up @@ -319,12 +319,13 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
v9ses->flags |= V9FS_ACCESS_CLIENT;
} else {
uid_t uid;

v9ses->flags |= V9FS_ACCESS_SINGLE;
uid = simple_strtoul(s, &e, 10);
if (*e != '\0') {
ret = -EINVAL;
pr_info("Unknown access argument %s\n",
s);
r = kstrtouint(s, 10, &uid);
if (r) {
ret = r;
pr_info("Unknown access argument %s: %d\n",
s, r);
kfree(s);
continue;
}
Expand Down

0 comments on commit 10c69a0

Please sign in to comment.