Staging: batman-adv: Don't allocate icmp packet with GFP_KERNEL

A new buffer for a packet is created when a icmp packet is received.
This happens in a context with disabled irq. Thus we are not allowed to
sleep or call function which might sleep. kmalloc must be called with
GFP_ATOMIC instead of GFP_KERNEL to ensure that it does not sleep.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Sven Eckelmann 2010-05-22 17:48:47 +02:00 коммит произвёл Greg Kroah-Hartman
Родитель 3d9b235893
Коммит 0375fc4d27
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -309,7 +309,7 @@ void bat_device_add_packet(struct device_client *device_client,
struct device_packet *device_packet; struct device_packet *device_packet;
unsigned long flags; unsigned long flags;
device_packet = kmalloc(sizeof(struct device_packet), GFP_KERNEL); device_packet = kmalloc(sizeof(struct device_packet), GFP_ATOMIC);
if (!device_packet) if (!device_packet)
return; return;