From: Fabian Frederick Date: Wed, 4 Jun 2014 23:12:21 +0000 (-0700) Subject: fs/ncpfs/getopt.c: replace simple_strtoul by kstrtoul X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8091b895b76f690aa2f6689b6ed602f07525a938;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git fs/ncpfs/getopt.c: replace simple_strtoul by kstrtoul Remove obsolete simple_strtoul in ncp_getopt Signed-off-by: Fabian Frederick Cc: Petr Vandrovec Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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 return -EINVAL; } if (opts->has_arg & OPT_INT) { - char* v; + int rc = kstrtoul(val, 0, value); - *value = simple_strtoul(val, &v, 0); - if (!*v) { - return opts->val; + if (rc) { + pr_info("%s: invalid numeric value in %s=%s\n", + caller, token, val); + return rc; } - pr_info("%s: invalid numeric value in %s=%s\n", - caller, token, val); - return -EDOM; + return opts->val; } if (opts->has_arg & OPT_STRING) { return opts->val;