Commit e1e420c7 authored by Shuah Khan's avatar Shuah Khan Committed by David S. Miller
Browse files

net/core: simple_strtoul cleanup



Changed net/core/net-sysfs.c: netdev_store() to use kstrtoul()
instead of obsolete simple_strtoul().

Signed-off-by: default avatarShuah Khan <shuahkhan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1caf09df
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -74,15 +74,14 @@ static ssize_t netdev_store(struct device *dev, struct device_attribute *attr,
			    int (*set)(struct net_device *, unsigned long))
			    int (*set)(struct net_device *, unsigned long))
{
{
	struct net_device *net = to_net_dev(dev);
	struct net_device *net = to_net_dev(dev);
	char *endp;
	unsigned long new;
	unsigned long new;
	int ret = -EINVAL;
	int ret = -EINVAL;


	if (!capable(CAP_NET_ADMIN))
	if (!capable(CAP_NET_ADMIN))
		return -EPERM;
		return -EPERM;


	new = simple_strtoul(buf, &endp, 0);
	ret = kstrtoul(buf, 0, &new);
	if (endp == buf)
	if (ret)
		goto err;
		goto err;


	if (!rtnl_trylock())
	if (!rtnl_trylock())