Commit 871b4b48 authored by chenqiwu's avatar chenqiwu Committed by Kalle Valo

b43legacy: replace simple_strtol() with kstrtoint()

The simple_strtol() function is deprecated since it does not
check for the range overflow. Use kstrtoint() instead.
Signed-off-by: default avatarchenqiwu <chenqiwu@xiaomi.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 90a39326
...@@ -25,13 +25,15 @@ ...@@ -25,13 +25,15 @@
static int get_integer(const char *buf, size_t count) static int get_integer(const char *buf, size_t count)
{ {
char tmp[10 + 1] = { 0 }; char tmp[10 + 1] = { 0 };
int ret = -EINVAL; int ret = -EINVAL, res;
if (count == 0) if (count == 0)
goto out; goto out;
count = min_t(size_t, count, 10); count = min_t(size_t, count, 10);
memcpy(tmp, buf, count); memcpy(tmp, buf, count);
ret = simple_strtol(tmp, NULL, 10); ret = kstrtoint(tmp, 10, &res);
if (!ret)
return res;
out: out:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment