From patchwork Wed May 19 19:12:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 114 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 6FC8E154311 for ; Wed, 19 May 2010 15:48:56 +0200 (CEST) Received: (qmail invoked by alias); 19 May 2010 19:12:39 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.192.108] by mail.gmx.net (mp064) with SMTP; 19 May 2010 21:12:39 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1/38h1Ucn/3nt3ea0Mg4zLaMXMk4EsR5hkGheyxvE 0G2a5yBAQ82WP8 From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 19 May 2010 21:12:37 +0200 Message-Id: <1274296357-17903-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274295600-16987-1-git-send-email-sven.eckelmann@gmx.de> References: <1274295600-16987-1-git-send-email-sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH-maint] 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:48:56 -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 --- 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;