b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH-maint] batman-adv: Don't allocate icmp packet with GFP_KERNEL
Date: Wed, 19 May 2010 21:12:37 +0200	[thread overview]
Message-ID: <1274296357-17903-1-git-send-email-sven.eckelmann@gmx.de> (raw)
In-Reply-To: <1274295600-16987-1-git-send-email-sven.eckelmann@gmx.de>

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 --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;
-- 
1.7.1


  reply	other threads:[~2010-05-19 19:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 19:00 [B.A.T.M.A.N.] [PATCH] batman-adv: Don't allocate icmp packet with GFP_KERNEL Sven Eckelmann
2010-05-19 19:12 ` Sven Eckelmann [this message]
2010-05-21 15:25 ` Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274296357-17903-1-git-send-email-sven.eckelmann@gmx.de \
    --to=sven.eckelmann@gmx.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).