From: Pekka Enberg Date: Thu, 11 Jun 2009 11:46:49 +0000 (+0300) Subject: irq: use kcalloc() instead of the bootmem allocator X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=22fb4e71e646695c7e0f379ada66b372c2d1aa1a;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git irq: use kcalloc() instead of the bootmem allocator Fixes the following problem: [ 0.000000] Experimental hierarchical RCU init done. [ 0.000000] NR_IRQS:4352 nr_irqs:256 [ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: at mm/bootmem.c:537 alloc_arch_preferred_bootmem+0x40/0x7e() [ 0.000000] Hardware name: To Be Filled By O.E.M. [ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.30-tip-02161-g7a74539-dirty #59709 [ 0.000000] Call Trace: [ 0.000000] [] ? alloc_arch_preferred_bootmem+0x40/0x7e [ 0.000000] [] warn_slowpath_common+0x88/0xcb [ 0.000000] [] warn_slowpath_null+0x27/0x3d [ 0.000000] [] alloc_arch_preferred_bootmem+0x40/0x7e [ 0.000000] [] ___alloc_bootmem_nopanic+0x4e/0xec [ 0.000000] [] ___alloc_bootmem+0x20/0x61 [ 0.000000] [] __alloc_bootmem+0x1e/0x34 [ 0.000000] [] early_irq_init+0x6d/0x118 [ 0.000000] [] ? early_idt_handler+0x0/0x71 [ 0.000000] [] start_kernel+0x192/0x394 [ 0.000000] [] ? early_idt_handler+0x0/0x71 [ 0.000000] [] x86_64_start_reservations+0xb4/0xcf [ 0.000000] [] ? __init_begin+0x0/0x140 [ 0.000000] [] x86_64_start_kernel+0x158/0x17b [ 0.000000] ---[ end trace a7919e7f17c0a725 ]--- [ 0.000000] Fast TSC calibration using PIT [ 0.000000] Detected 2002.510 MHz processor. [ 0.004000] Console: colour VGA+ 80x25 Reported-by: Ingo Molnar Signed-off-by: Pekka Enberg --- diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index e161999b668..10457854123 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c @@ -164,7 +164,7 @@ int __init early_irq_init(void) node = first_online_node; /* allocate irq_desc_ptrs array based on nr_irqs */ - irq_desc_ptrs = alloc_bootmem(nr_irqs * sizeof(void *)); + irq_desc_ptrs = kcalloc(nr_irqs, sizeof(void *), GFP_NOWAIT); /* allocate based on nr_cpu_ids */ kstat_irqs_legacy = kzalloc_node(NR_IRQS_LEGACY * nr_cpu_ids *