From: Linus Torvalds Date: Sat, 1 Nov 2008 16:53:58 +0000 (-0700) Subject: reserve_region_with_split: Fix GFP_KERNEL usage under spinlock X-Git-Tag: v2.6.28-rc3~14 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=42c0202363194007a1ac377d047a95aa39246eb0;p=linux-2.6-omap-h63xx.git reserve_region_with_split: Fix GFP_KERNEL usage under spinlock This one apparently doesn't generate any warnings, because the function is only used during system bootup, when the warnings are disabled. But it's still very wrong. The __reserve_region_with_split() function is called with the resource_lock held for writing, so it must only ever do GFP_ATOMIC allocations. Signed-off-by: Linus Torvalds --- diff --git a/kernel/resource.c b/kernel/resource.c index 6aac5c60b25..4337063663e 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -523,7 +523,7 @@ static void __init __reserve_region_with_split(struct resource *root, { struct resource *parent = root; struct resource *conflict; - struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); + struct resource *res = kzalloc(sizeof(*res), GFP_ATOMIC); if (!res) return;