Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28e08861 authored by Christophe Saout's avatar Christophe Saout Committed by Ingo Molnar
Browse files

xen: fix too early kmalloc call



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: default avatarChristophe Saout <christophe@saout.de>
Signed-off-by: default avatarMike Travis <travis@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 92296c6d
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@
#include <linux/irq.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/string.h>
#include <linux/bootmem.h>


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


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


	init_evtchn_cpu_bindings();
	init_evtchn_cpu_bindings();