diff options
author | chenqiwu <chenqiwu@xiaomi.com> | 2020-02-19 05:15:59 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-03-12 14:40:45 +0100 |
commit | 871b4b48cdbfe4fb7f687801fc265619b35cf476 (patch) | |
tree | 6c2c7856e7014bf58598aa7336ddec6b198c0ccf /drivers/net/wireless/broadcom/b43legacy | |
parent | rtw88: remove unused member of struct rtw_hal (diff) | |
download | linux-871b4b48cdbfe4fb7f687801fc265619b35cf476.tar.xz linux-871b4b48cdbfe4fb7f687801fc265619b35cf476.zip |
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: chenqiwu <chenqiwu@xiaomi.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/broadcom/b43legacy')
-rw-r--r-- | drivers/net/wireless/broadcom/b43legacy/sysfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/broadcom/b43legacy/sysfs.c b/drivers/net/wireless/broadcom/b43legacy/sysfs.c index 9312c1dd3417..eec087ca30e6 100644 --- a/drivers/net/wireless/broadcom/b43legacy/sysfs.c +++ b/drivers/net/wireless/broadcom/b43legacy/sysfs.c @@ -25,13 +25,15 @@ static int get_integer(const char *buf, size_t count) { char tmp[10 + 1] = { 0 }; - int ret = -EINVAL; + int ret = -EINVAL, res; if (count == 0) goto out; count = min_t(size_t, count, 10); memcpy(tmp, buf, count); - ret = simple_strtol(tmp, NULL, 10); + ret = kstrtoint(tmp, 10, &res); + if (!ret) + return res; out: return ret; } |