diff options
Diffstat (limited to 'lib/kstrtox.c')
-rw-r--r-- | lib/kstrtox.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/kstrtox.c b/lib/kstrtox.c index 05672e819f8c..a235f3cc471c 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c | |||
@@ -49,12 +49,9 @@ static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res) | |||
49 | val = *s - '0'; | 49 | val = *s - '0'; |
50 | else if ('a' <= _tolower(*s) && _tolower(*s) <= 'f') | 50 | else if ('a' <= _tolower(*s) && _tolower(*s) <= 'f') |
51 | val = _tolower(*s) - 'a' + 10; | 51 | val = _tolower(*s) - 'a' + 10; |
52 | else if (*s == '\n') { | 52 | else if (*s == '\n' && *(s + 1) == '\0') |
53 | if (*(s + 1) == '\0') | 53 | break; |
54 | break; | 54 | else |
55 | else | ||
56 | return -EINVAL; | ||
57 | } else | ||
58 | return -EINVAL; | 55 | return -EINVAL; |
59 | 56 | ||
60 | if (val >= base) | 57 | if (val >= base) |