Commit 5a5990d3 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

net: Avoid race between network down and sysfs

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07555c98
......@@ -77,7 +77,9 @@ static ssize_t netdev_store(struct device *dev, struct device_attribute *attr,
if (endp == buf)
goto err;
rtnl_lock();
if (!rtnl_trylock())
return -ERESTARTSYS;
if (dev_isalive(net)) {
if ((ret = (*set)(net, new)) == 0)
ret = len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment