patch-2.4.21 linux-2.4.21/net/bridge/br_if.c

Next file: linux-2.4.21/net/bridge/br_ioctl.c
Previous file: linux-2.4.21/net/bluetooth/syms.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/net/bridge/br_if.c linux-2.4.21/net/bridge/br_if.c
@@ -143,7 +143,7 @@
 	int i;
 	struct net_bridge_port *p;
 
-	p = kmalloc(sizeof(*p), GFP_KERNEL);
+	p = kmalloc(sizeof(*p), GFP_ATOMIC);
 	if (p == NULL)
 		return p;
 
@@ -153,8 +153,6 @@
 	p->path_cost = br_initial_port_cost(dev);
 	p->priority = 0x80;
 
-	dev->br_port = p;
-
 	for (i=1;i<255;i++)
 		if (br_get_port(br, i) == NULL)
 			break;
@@ -164,6 +162,8 @@
 		return NULL;
 	}
 
+	dev->br_port = p;
+
 	p->port_no = i;
 	br_init_port(p);
 	p->state = BR_STATE_DISABLED;

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