Skip to content

Commit

Permalink
[PATCH] R3964: fix GFP_KERNEL allocations in timer function
Browse files Browse the repository at this point in the history
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 <chw@ch-werner.de> for reporting, and for the initial fix.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
David Woodhouse authored and Linus Torvalds committed Jun 25, 2006
1 parent c836043 commit 78dbe70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/char/n_r3964.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 78dbe70

Please sign in to comment.