From: David Woodhouse Date: Sun, 25 Jun 2006 12:48:41 +0000 (-0700) Subject: [PATCH] R3964: fix GFP_KERNEL allocations in timer function X-Git-Tag: v2.6.18-rc1~933 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78dbe706e22f54bce61571ad837238382e1ba5f9;p=linux-2.6 [PATCH] R3964: fix GFP_KERNEL allocations in timer function In the error case, add_msg() gets called from timer functions, so should be using GFP_ATOMIC instead of GFP_KERNEL. Ref: http://bugzilla.kernel.org/show_bug.cgi?id=6659. Thanks to Christian Werner for reporting, and for the initial fix. Signed-off-by: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c index c48de09d68..203dc2b661 100644 --- a/drivers/char/n_r3964.c +++ b/drivers/char/n_r3964.c @@ -951,7 +951,8 @@ static void add_msg(struct r3964_client_info *pClient, int msg_id, int arg, { queue_the_message: - pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL); + pMsg = kmalloc(sizeof(struct r3964_message), + error_code?GFP_ATOMIC:GFP_KERNEL); TRACE_M("add_msg - kmalloc %p",pMsg); if(pMsg==NULL) { return;