diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/cache.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index f792794f6634..5dc9ee4d616e 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -217,6 +217,8 @@ extern int qword_get(char **bpp, char *dest, int bufsize); | |||
217 | static inline int get_int(char **bpp, int *anint) | 217 | static inline int get_int(char **bpp, int *anint) |
218 | { | 218 | { |
219 | char buf[50]; | 219 | char buf[50]; |
220 | char *ep; | ||
221 | int rv; | ||
220 | int len = qword_get(bpp, buf, sizeof(buf)); | 222 | int len = qword_get(bpp, buf, sizeof(buf)); |
221 | 223 | ||
222 | if (len < 0) | 224 | if (len < 0) |
@@ -224,9 +226,11 @@ static inline int get_int(char **bpp, int *anint) | |||
224 | if (len == 0) | 226 | if (len == 0) |
225 | return -ENOENT; | 227 | return -ENOENT; |
226 | 228 | ||
227 | if (kstrtoint(buf, 0, anint)) | 229 | rv = simple_strtol(buf, &ep, 0); |
230 | if (*ep) | ||
228 | return -EINVAL; | 231 | return -EINVAL; |
229 | 232 | ||
233 | *anint = rv; | ||
230 | return 0; | 234 | return 0; |
231 | } | 235 | } |
232 | 236 | ||