From: Peter Dinda Date: Thu, 10 Nov 2011 23:25:58 +0000 (-0600) Subject: Changed memory allocation to avoid possible deadlock (GFP_KERNEL while lock held) X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=80a7fd2f343c65c00d84bc64181d0e9720ae20a6 Changed memory allocation to avoid possible deadlock (GFP_KERNEL while lock held) --- diff --git a/linux_module/iface-packet.c b/linux_module/iface-packet.c index f3562b0..3acb4bf 100644 --- a/linux_module/iface-packet.c +++ b/linux_module/iface-packet.c @@ -252,7 +252,11 @@ palacios_packet_connect(struct v3_packet * packet, iface = find_interface(host_nic); if(iface == NULL){ - iface = (struct raw_interface *)kmalloc(sizeof(struct raw_interface), GFP_KERNEL); + iface = (struct raw_interface *)kmalloc(sizeof(struct raw_interface), GFP_ATOMIC); + 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);