diff mbox

[maint] batman-adv: Don't allocate icmp packet with GFP_KERNEL

Message ID 1274296357-17903-1-git-send-email-sven.eckelmann@gmx.de
State Accepted, archived
Commit a1b75ab31425cf5021d817cf370e7a11c023849d
Headers show

Commit Message

Sven Eckelmann May 19, 2010, 7:12 p.m. UTC
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>
---
This patch is created for maint and should be applied using `git am`.
Following patches should be applied before:
 * batman-adv: Move device for icmp injection to debugfs
 * batman-adv: Move tables from sysfs to debugfs
 * batman-adv: Call unregister_netdev on failures to get rtnl lock
 * batman-adv: Don't call free_netdev twice

 icmp_socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/icmp_socket.c b/icmp_socket.c
index eba8aa2..d74e2d6 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -284,7 +284,7 @@  static void bat_socket_add_packet(struct socket_client *socket_client,
 	struct socket_packet *socket_packet;
 	unsigned long flags;
 
-	socket_packet = kmalloc(sizeof(struct socket_packet), GFP_KERNEL);
+	socket_packet = kmalloc(sizeof(struct socket_packet), GFP_ATOMIC);
 
 	if (!socket_packet)
 		return;