diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/addr.c | 16 | ||||
-rw-r--r-- | net/sunrpc/auth.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 4 |
3 files changed, 9 insertions, 13 deletions
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c index a622ad64acd8..2e0a6f92e563 100644 --- a/net/sunrpc/addr.c +++ b/net/sunrpc/addr.c | |||
@@ -176,7 +176,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf, | |||
176 | len = (buf + buflen) - delim - 1; | 176 | len = (buf + buflen) - delim - 1; |
177 | p = kstrndup(delim + 1, len, GFP_KERNEL); | 177 | p = kstrndup(delim + 1, len, GFP_KERNEL); |
178 | if (p) { | 178 | if (p) { |
179 | unsigned long scope_id = 0; | 179 | u32 scope_id = 0; |
180 | struct net_device *dev; | 180 | struct net_device *dev; |
181 | 181 | ||
182 | dev = dev_get_by_name(net, p); | 182 | dev = dev_get_by_name(net, p); |
@@ -184,7 +184,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf, | |||
184 | scope_id = dev->ifindex; | 184 | scope_id = dev->ifindex; |
185 | dev_put(dev); | 185 | dev_put(dev); |
186 | } else { | 186 | } else { |
187 | if (strict_strtoul(p, 10, &scope_id) == 0) { | 187 | if (kstrtou32(p, 10, &scope_id) == 0) { |
188 | kfree(p); | 188 | kfree(p); |
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
@@ -304,7 +304,7 @@ char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags) | |||
304 | * @sap: buffer into which to plant socket address | 304 | * @sap: buffer into which to plant socket address |
305 | * @salen: size of buffer | 305 | * @salen: size of buffer |
306 | * | 306 | * |
307 | * @uaddr does not have to be '\0'-terminated, but strict_strtoul() and | 307 | * @uaddr does not have to be '\0'-terminated, but kstrtou8() and |
308 | * rpc_pton() require proper string termination to be successful. | 308 | * rpc_pton() require proper string termination to be successful. |
309 | * | 309 | * |
310 | * Returns the size of the socket address if successful; otherwise | 310 | * Returns the size of the socket address if successful; otherwise |
@@ -315,7 +315,7 @@ size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr, | |||
315 | const size_t salen) | 315 | const size_t salen) |
316 | { | 316 | { |
317 | char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')]; | 317 | char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')]; |
318 | unsigned long portlo, porthi; | 318 | u8 portlo, porthi; |
319 | unsigned short port; | 319 | unsigned short port; |
320 | 320 | ||
321 | if (uaddr_len > RPCBIND_MAXUADDRLEN) | 321 | if (uaddr_len > RPCBIND_MAXUADDRLEN) |
@@ -327,18 +327,14 @@ size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr, | |||
327 | c = strrchr(buf, '.'); | 327 | c = strrchr(buf, '.'); |
328 | if (unlikely(c == NULL)) | 328 | if (unlikely(c == NULL)) |
329 | return 0; | 329 | return 0; |
330 | if (unlikely(strict_strtoul(c + 1, 10, &portlo) != 0)) | 330 | if (unlikely(kstrtou8(c + 1, 10, &portlo) != 0)) |
331 | return 0; | ||
332 | if (unlikely(portlo > 255)) | ||
333 | return 0; | 331 | return 0; |
334 | 332 | ||
335 | *c = '\0'; | 333 | *c = '\0'; |
336 | c = strrchr(buf, '.'); | 334 | c = strrchr(buf, '.'); |
337 | if (unlikely(c == NULL)) | 335 | if (unlikely(c == NULL)) |
338 | return 0; | 336 | return 0; |
339 | if (unlikely(strict_strtoul(c + 1, 10, &porthi) != 0)) | 337 | if (unlikely(kstrtou8(c + 1, 10, &porthi) != 0)) |
340 | return 0; | ||
341 | if (unlikely(porthi > 255)) | ||
342 | return 0; | 338 | return 0; |
343 | 339 | ||
344 | port = (unsigned short)((porthi << 8) | portlo); | 340 | port = (unsigned short)((porthi << 8) | portlo); |
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 1481efff6aa2..2bc7bb82b162 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
@@ -48,7 +48,7 @@ static int param_set_hashtbl_sz(const char *val, const struct kernel_param *kp) | |||
48 | 48 | ||
49 | if (!val) | 49 | if (!val) |
50 | goto out_inval; | 50 | goto out_inval; |
51 | ret = strict_strtoul(val, 0, &num); | 51 | ret = kstrtoul(val, 0, &num); |
52 | if (ret == -EINVAL) | 52 | if (ret == -EINVAL) |
53 | goto out_inval; | 53 | goto out_inval; |
54 | nbits = fls(num); | 54 | nbits = fls(num); |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 8f8589fedfdd..43cd89eacfab 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -3059,12 +3059,12 @@ static int param_set_uint_minmax(const char *val, | |||
3059 | const struct kernel_param *kp, | 3059 | const struct kernel_param *kp, |
3060 | unsigned int min, unsigned int max) | 3060 | unsigned int min, unsigned int max) |
3061 | { | 3061 | { |
3062 | unsigned long num; | 3062 | unsigned int num; |
3063 | int ret; | 3063 | int ret; |
3064 | 3064 | ||
3065 | if (!val) | 3065 | if (!val) |
3066 | return -EINVAL; | 3066 | return -EINVAL; |
3067 | ret = strict_strtoul(val, 0, &num); | 3067 | ret = kstrtouint(val, 0, &num); |
3068 | if (ret == -EINVAL || num < min || num > max) | 3068 | if (ret == -EINVAL || num < min || num > max) |
3069 | return -EINVAL; | 3069 | return -EINVAL; |
3070 | *((unsigned int *)kp->arg) = num; | 3070 | *((unsigned int *)kp->arg) = num; |