Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

net: Avoid race between network down and sysfs

parent 07555c98
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;