Skip to contentSkip to conversation

(3/7) ipmr.c - drop/reacquire in error path.

PATCH New Stephen Hemminger 1 participant 1 message Jun 25, 2003

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 (3/7) ipmr.c - drop/reacquire in error path.

In the failure path, need to drop/re-acquire locking to allow sysfs and hotplug to run.

net/ipv4/ipmr.c +8 -0
diff -Nru a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
@@ -158,6 +158,10 @@
 	return dev;
 
 failure:
+	/* allow the register to be completed before unregistering. */
+	rtnl_unlock();
+	rtnl_lock();
+
 	unregister_netdevice(dev);
 	return NULL;
 }
@@ -228,6 +232,10 @@
 	return dev;
 
 failure:
+	/* allow the register to be completed before unregistering. */
+	rtnl_unlock();
+	rtnl_lock();
+
 	unregister_netdevice(dev);
 	return NULL;
 }