b43legacy/sysfs.c: replace simple_strtol() with kstrtoint()
PATCH 1/1 b43legacy/sysfs.c: replace simple_strtol() with kstrtoint()
From: chenqiwu <[email protected]>
The simple_strtol() function is deprecated since it does not check for the range overflow. Use kstrtoint() instead.
Signed-off-by chenqiwu <[email protected]>
--- drivers/net/wireless/broadcom/b43legacy/sysfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/b43legacy/sysfs.c +4 -2
@@ -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; }
Signature · 1 line
1.9.1
Re: [PATCH] b43legacy: replace simple_strtol() with kstrtoint()
Quoted 6 lines · [email protected] wrote:
From: chenqiwu <[email protected]>
The
simple_strtol()function is deprecated since it does not check for the range overflow. Usekstrtoint()instead.Signed-off-by chenqiwu <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
871b4b48cdbf b43legacy: replace simple_strtol() with kstrtoint()
Signature · 3 lines
https://patchwork.kernel.org/patch/11390321/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches