From: Patrick G. Bridges Date: Fri, 11 Nov 2011 16:52:12 +0000 (-0700) Subject: Merge branch 'devel' of ssh://newskysaw.cs.northwestern.edu/home/palacios/palacios... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=7f5af6dae89572f00563cde3165b87b83c3ed7e4;hp=dc41a5e6b7601dcdf9eb2ac84dbf297cac037f5b Merge branch 'devel' of ssh://newskysaw.cs.northwestern.edu/home/palacios/palacios into devel --- diff --git a/linux_module/iface-packet.c b/linux_module/iface-packet.c index f3562b0..9df66bd 100644 --- a/linux_module/iface-packet.c +++ b/linux_module/iface-packet.c @@ -249,23 +249,25 @@ palacios_packet_connect(struct v3_packet * packet, unsigned long flags; spin_lock_irqsave(&(packet_state.lock), flags); - iface = find_interface(host_nic); + spin_unlock_irqrestore(&(packet_state.lock),flags); + if(iface == NULL){ iface = (struct raw_interface *)kmalloc(sizeof(struct raw_interface), GFP_KERNEL); + if (!iface) { + printk("Palacios Packet Interface: Fails to allocate interface\n"); + return -1; + } if(init_raw_interface(iface, host_nic) != 0) { printk("Palacios Packet Interface: Fails to initiate an raw interface on device %s\n", host_nic); kfree(iface); - spin_unlock_irqrestore(&(packet_state.lock), flags); - return -1; } - + spin_lock_irqsave(&(packet_state.lock), flags); list_add(&(iface->node), &(packet_state.open_interfaces)); + spin_unlock_irqrestore(&(packet_state.lock),flags); } - spin_unlock_irqrestore(&(packet_state.lock), flags); - packet->host_packet_data = iface; list_add(&(packet->node), &(iface->brdcast_recvers));