diff options
author | Eldad Zack <eldad@fogrefinery.com> | 2012-05-19 10:13:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-20 04:06:17 -0400 |
commit | 413c27d8697751f72d2d6cf289140a8e060a8032 (patch) | |
tree | ed13d36cfc8651b542eca7c1f92e4f9a09fe6e7d /net/ipv4/udp.c | |
parent | b37f4d7b011955c84cdbb8c370927d93701fb174 (diff) |
net/ipv4: replace simple_strtoul with kstrtoul
Replace simple_strtoul with kstrtoul in three similar occurrences, all setup
handlers:
* route.c: set_rhash_entries
* tcp.c: set_thash_entries
* udp.c: set_uhash_entries
Also check if the conversion failed.
Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 279fd0846302..609397ee78fb 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -2173,9 +2173,15 @@ void udp4_proc_exit(void) | |||
2173 | static __initdata unsigned long uhash_entries; | 2173 | static __initdata unsigned long uhash_entries; |
2174 | static int __init set_uhash_entries(char *str) | 2174 | static int __init set_uhash_entries(char *str) |
2175 | { | 2175 | { |
2176 | ssize_t ret; | ||
2177 | |||
2176 | if (!str) | 2178 | if (!str) |
2177 | return 0; | 2179 | return 0; |
2178 | uhash_entries = simple_strtoul(str, &str, 0); | 2180 | |
2181 | ret = kstrtoul(str, 0, &uhash_entries); | ||
2182 | if (ret) | ||
2183 | return 0; | ||
2184 | |||
2179 | if (uhash_entries && uhash_entries < UDP_HTABLE_SIZE_MIN) | 2185 | if (uhash_entries && uhash_entries < UDP_HTABLE_SIZE_MIN) |
2180 | uhash_entries = UDP_HTABLE_SIZE_MIN; | 2186 | uhash_entries = UDP_HTABLE_SIZE_MIN; |
2181 | return 1; | 2187 | return 1; |