Skip to content

Commit

Permalink
reserve_region_with_split: Fix GFP_KERNEL usage under spinlock
Browse files Browse the repository at this point in the history
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 <torvalds@linux-foundation.org>
  • Loading branch information
torvalds committed Nov 1, 2008
1 parent cdce1f0 commit 42c0202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 42c0202

Please sign in to comment.