projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
024b7d6
)
9p v9fs_parse_options: replace simple_strtoul with kstrtouint
author
Dominique Martinet
<asmadeus@codewreck.org>
Tue, 2 Nov 2021 13:23:37 +0000
(22:23 +0900)
committer
Dominique Martinet
<asmadeus@codewreck.org>
Wed, 3 Nov 2021 08:45:04 +0000
(17:45 +0900)
This is also a checkpatch change, but this one might have more implications
so keeping this separate
Link:
http://lkml.kernel.org/r/20211102134608.1588018-4-dominique.martinet@atmark-techno.com
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
fs/9p/v9fs.c
patch
|
blob
|
history
diff --git
a/fs/9p/v9fs.c
b/fs/9p/v9fs.c
index 0973d7a3536b03b3d12396f2e1bda96625809270..457d9ff584ec170dde663f5687fb9af02896dd4a 100644
(file)
--- a/
fs/9p/v9fs.c
+++ b/
fs/9p/v9fs.c
@@
-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 */
@@
-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;
}