linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] b43legacy/sysfs.c: replace simple_strtol() with kstrtoint()
@ 2020-02-19  4:15 qiwuchen55
  2020-03-12 13:41 ` [PATCH] b43legacy: " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: qiwuchen55 @ 2020-02-19  4:15 UTC (permalink / raw)
  To: Larry.Finger, kvalo, davem; +Cc: linux-wireless, b43-dev, chenqiwu

From: chenqiwu <chenqiwu@xiaomi.com>

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>
---
 drivers/net/wireless/broadcom/b43legacy/sysfs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43legacy/sysfs.c b/drivers/net/wireless/broadcom/b43legacy/sysfs.c
index 9312c1d..eec087c 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;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] b43legacy: replace simple_strtol() with kstrtoint()
  2020-02-19  4:15 [PATCH] b43legacy/sysfs.c: replace simple_strtol() with kstrtoint() qiwuchen55
@ 2020-03-12 13:41 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-03-12 13:41 UTC (permalink / raw)
  To: qiwuchen55; +Cc: Larry.Finger, davem, linux-wireless, b43-dev, chenqiwu

qiwuchen55@gmail.com wrote:

> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> 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>

Patch applied to wireless-drivers-next.git, thanks.

871b4b48cdbf b43legacy: replace simple_strtol() with kstrtoint()

-- 
https://patchwork.kernel.org/patch/11390321/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-12 13:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-19  4:15 [PATCH] b43legacy/sysfs.c: replace simple_strtol() with kstrtoint() qiwuchen55
2020-03-12 13:41 ` [PATCH] b43legacy: " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).