Skip to content

Commit

Permalink
xen: fix too early kmalloc call
Browse files Browse the repository at this point in the history
Impact: fix bootup crash on xen guests

SLAB is not yet up, with earlyprintk it is giving me an Oops in __kmalloc.

Replace call to kmalloc() with alloc_bootmem().

Reported-by: Christophe Saout <christophe@saout.de>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Christophe Saout authored and Ingo Molnar committed Jan 12, 2009
1 parent 92296c6 commit 28e0886
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/bootmem.h>

#include <asm/ptrace.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -831,8 +832,8 @@ void __init xen_init_IRQ(void)
int i;
size_t size = nr_cpu_ids * sizeof(struct cpu_evtchn_s);

cpu_evtchn_mask_p = kmalloc(size, GFP_KERNEL);
BUG_ON(cpu_evtchn_mask == NULL);
cpu_evtchn_mask_p = alloc_bootmem(size);
BUG_ON(cpu_evtchn_mask_p == NULL);

init_evtchn_cpu_bindings();

Expand Down

0 comments on commit 28e0886

Please sign in to comment.