Skip to content

Commit

Permalink
net/bridge: replace simple_strtoul to kstrtol
Browse files Browse the repository at this point in the history
simple_strtoull is obsolete, use kstrtol instead.

Signed-off-by: Bernard Zhao <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Bernard Zhao authored and davem330 committed Nov 19, 2021
1 parent eaa54d6 commit 520fbdf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/bridge/br_sysfs_br.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 520fbdf

Please sign in to comment.