patch-2.4.15 linux/net/atm/resources.c

Next file: linux/net/bluetooth/hci_core.c
Previous file: linux/net/atm/pppoatm.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.14/linux/net/atm/resources.c linux/net/atm/resources.c
@@ -36,13 +36,18 @@
 	if (!dev) return NULL;
 	memset(dev,0,sizeof(*dev));
 	dev->type = type;
-	dev->prev = last_dev;
 	dev->signal = ATM_PHY_SIG_UNKNOWN;
 	dev->link_rate = ATM_OC3_PCR;
 	dev->next = NULL;
+
+	spin_lock(&atm_dev_lock);
+
+	dev->prev = last_dev;
+
 	if (atm_devs) last_dev->next = dev;
 	else atm_devs = dev;
 	last_dev = dev;
+	spin_unlock(&atm_dev_lock);
 	return dev;
 }
 

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