diff options
-rw-r--r-- | fs/ncpfs/getopt.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/ncpfs/getopt.c b/fs/ncpfs/getopt.c index 03ffde1f44d6..344889cd120e 100644 --- a/fs/ncpfs/getopt.c +++ b/fs/ncpfs/getopt.c | |||
@@ -53,15 +53,14 @@ int ncp_getopt(const char *caller, char **options, const struct ncp_option *opts | |||
53 | return -EINVAL; | 53 | return -EINVAL; |
54 | } | 54 | } |
55 | if (opts->has_arg & OPT_INT) { | 55 | if (opts->has_arg & OPT_INT) { |
56 | char* v; | 56 | int rc = kstrtoul(val, 0, value); |
57 | 57 | ||
58 | *value = simple_strtoul(val, &v, 0); | 58 | if (rc) { |
59 | if (!*v) { | 59 | pr_info("%s: invalid numeric value in %s=%s\n", |
60 | return opts->val; | 60 | caller, token, val); |
61 | return rc; | ||
61 | } | 62 | } |
62 | pr_info("%s: invalid numeric value in %s=%s\n", | 63 | return opts->val; |
63 | caller, token, val); | ||
64 | return -EDOM; | ||
65 | } | 64 | } |
66 | if (opts->has_arg & OPT_STRING) { | 65 | if (opts->has_arg & OPT_STRING) { |
67 | return opts->val; | 66 | return opts->val; |