patch-2.3.4 linux/net/x25/af_x25.c

Next file: linux/CREDITS
Previous file: linux/net/unix/af_unix.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.3/linux/net/x25/af_x25.c linux/net/x25/af_x25.c
@@ -1336,14 +1336,20 @@
 	/*
 	 *	Register any pre existing devices.
 	 */
-	for (dev = dev_base; dev != NULL; dev = dev->next)
+	read_lock_bh(&dev_base_lock);
+	for (dev = dev_base; dev != NULL; dev = dev->next) {
 		if ((dev->flags & IFF_UP) && (dev->type == ARPHRD_X25
 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
 					   || dev->type == ARPHRD_ETHER
 #endif
-									))
-		x25_link_device_up(dev);
-	
+			)) {
+			read_unlock_bh(&dev_base_lock);
+			x25_link_device_up(dev);
+			read_lock_bh(&dev_base_lock);
+		}
+	}
+	read_unlock_bh(&dev_base_lock);
+
 	return 0;
 }
 


FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)