Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <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>

authored by

David Woodhouse and committed by
Linus Torvalds
78dbe706 c836043e

+2 -1
+2 -1
drivers/char/n_r3964.c
··· 951 951 { 952 952 queue_the_message: 953 953 954 - pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL); 954 + pMsg = kmalloc(sizeof(struct r3964_message), 955 + error_code?GFP_ATOMIC:GFP_KERNEL); 955 956 TRACE_M("add_msg - kmalloc %p",pMsg); 956 957 if(pMsg==NULL) { 957 958 return;