Skip to content

Commit

Permalink
Staging: batman-adv: Don't allocate icmp packet with GFP_KERNEL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sven Eckelmann authored and Greg Kroah-Hartman committed Jun 4, 2010
1 parent 3d9b235 commit 0375fc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/batman-adv/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void bat_device_add_packet(struct device_client *device_client,
struct device_packet *device_packet;
unsigned long flags;

device_packet = kmalloc(sizeof(struct device_packet), GFP_KERNEL);
device_packet = kmalloc(sizeof(struct device_packet), GFP_ATOMIC);

if (!device_packet)
return;
Expand Down

0 comments on commit 0375fc4

Please sign in to comment.