From patchwork Sat May 22 14:17:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 201 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 0CAB71544DA for ; Sat, 22 May 2010 10:53:59 +0200 (CEST) Received: (qmail invoked by alias); 22 May 2010 14:17:45 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.221.101] by mail.gmx.net (mp045) with SMTP; 22 May 2010 16:17:45 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX184EfJgvHc4+Ski4dZc+ti8R2qB67auP9mZ8ztpvB yb+6L3m3JMNe63 From: Sven Eckelmann To: gregkh@suse.de Date: Sat, 22 May 2010 16:17:10 +0200 Message-Id: <1274537833-2512-7-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <201005221616.46785.sven.eckelmann@gmx.de> References: <201005221616.46785.sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Cc: b.a.t.m.a.n@lists.open-mesh.net Subject: [B.A.T.M.A.N.] [PATCH 07/10] Staging: 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: Sat, 22 May 2010 08:53:59 -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 --- drivers/staging/batman-adv/icmp_socket.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/batman-adv/icmp_socket.c b/drivers/staging/batman-adv/icmp_socket.c index 748b4ae..f1d790b 100644 --- a/drivers/staging/batman-adv/icmp_socket.c +++ b/drivers/staging/batman-adv/icmp_socket.c @@ -283,7 +283,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;