linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/bridge: replace simple_strtoul to kstrtol
@ 2021-11-19  2:06 Bernard Zhao
  2021-11-19 14:20 ` patchwork-bot+netdevbpf
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Bernard Zhao @ 2021-11-19  2:06 UTC (permalink / raw)
  To: Roopa Prabhu, Nikolay Aleksandrov, David S. Miller,
	Jakub Kicinski, bridge, netdev, linux-kernel
  Cc: Bernard Zhao

simple_strtoull is obsolete, use kstrtol instead.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
 net/bridge/br_sysfs_br.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index d9a89ddd0331..11c490694296 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -36,15 +36,14 @@ static ssize_t store_bridge_parm(struct device *d,
 	struct net_bridge *br = to_bridge(d);
 	struct netlink_ext_ack extack = {0};
 	unsigned long val;
-	char *endp;
 	int err;
 
 	if (!ns_capable(dev_net(br->dev)->user_ns, CAP_NET_ADMIN))
 		return -EPERM;
 
-	val = simple_strtoul(buf, &endp, 0);
-	if (endp == buf)
-		return -EINVAL;
+	err = kstrtoul(buf, 10, &val);
+	if (err != 0)
+		return err;
 
 	if (!rtnl_trylock())
 		return restart_syscall();
-- 
2.33.1


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

end of thread, other threads:[~2021-11-24 10:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19  2:06 [PATCH] net/bridge: replace simple_strtoul to kstrtol Bernard Zhao
2021-11-19 14:20 ` patchwork-bot+netdevbpf
2021-11-20 21:57 ` David Laight
2021-11-22 10:04 ` Ido Schimmel
2021-11-22 10:17   ` Nikolay Aleksandrov
2021-11-24  4:13     ` Jakub Kicinski
2021-11-24 10:18       ` Nikolay Aleksandrov

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).