From: chenqiwu Date: Wed, 19 Feb 2020 04:15:59 +0000 (+0800) Subject: b43legacy: replace simple_strtol() with kstrtoint() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=871b4b48cdbfe4fb7f687801fc265619b35cf476;p=linux.git 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 Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/broadcom/b43legacy/sysfs.c b/drivers/net/wireless/broadcom/b43legacy/sysfs.c index 9312c1dd34177..eec087ca30e6e 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; }