From patchwork Wed May 19 19:00:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 123 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 84EA61542F6 for ; Wed, 19 May 2010 15:36:27 +0200 (CEST) Received: (qmail invoked by alias); 19 May 2010 19:00:01 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.192.108] by mail.gmx.net (mp059) with SMTP; 19 May 2010 21:00:01 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1+qHlhBhL+qKqycSTzN7gp8ygIKA337rlKQ4tH8o3 HWTWmVCR0bLNiH From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 19 May 2010 21:00:00 +0200 Message-Id: <1274295600-16987-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Don't allocate icmp packet with GFP_KERNEL X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2010 13:36:29 -0000 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 --- batman-adv-kernelland/icmp_socket.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/batman-adv-kernelland/icmp_socket.c b/batman-adv-kernelland/icmp_socket.c index 33d2714..becbb5b 100644 --- a/batman-adv-kernelland/icmp_socket.c +++ b/batman-adv-kernelland/icmp_socket.c @@ -292,7 +292,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;