* [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c
@ 2007-05-17 2:00 KAMEZAWA Hiroyuki
2007-05-17 19:19 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: KAMEZAWA Hiroyuki @ 2007-05-17 2:00 UTC (permalink / raw)
To: linux-ia64; +Cc: LKML, tony.luck, AKPM
Fix following kmalloc(0) message. patch is agaisnt 2.6.22-rc1-mm1.
==
BUG: at mm/slab.c:792 __find_general_cachep()
Call Trace:
[<a000000100013f20>] show_stack+0x40/0xa0
sp=e000014042227b00 bsp=e000014042220f90
[<a000000100013fb0>] dump_stack+0x30/0x60
sp=e000014042227cd0 bsp=e000014042220f78
[<a00000010014fe10>] kmem_find_general_cachep+0x90/0x140
sp=e000014042227cd0 bsp=e000014042220f48
[<a0000001001504f0>] __kmalloc_node+0x30/0xa0
sp=e000014042227cd0 bsp=e000014042220f18
[<a0000001004eb700>] pci_acpi_scan_root+0x180/0x4a0
sp=e000014042227cd0 bsp=e000014042220ed0
[<a000000100361140>] acpi_pci_root_add+0x4e0/0x700
sp=e000014042227cf0 bsp=e000014042220e90
[<a00000010035b240>] acpi_device_probe+0xa0/0x160
sp=e000014042227d10 bsp=e000014042220e58
[<a0000001003e4550>] driver_probe_device+0x250/0x380
sp=e000014042227d10 bsp=e000014042220e18
[<a0000001003e4900>] __driver_attach+0xc0/0x160
sp=e000014042227d10 bsp=e000014042220de0
[<a0000001003e2980>] bus_for_each_dev+0x80/0x100
sp=e000014042227d10 bsp=e000014042220da8
[<a0000001003e4120>] driver_attach+0x40/0x60
sp=e000014042227d30 bsp=e000014042220d88
[<a0000001003e3170>] bus_add_driver+0xf0/0x3c0
sp=e000014042227d30 bsp=e000014042220d48
[<a0000001003e4e00>] driver_register+0x140/0x160
sp=e000014042227d30 bsp=e000014042220d28
[<a00000010035ded0>] acpi_bus_register_driver+0x50/0x80
sp=e000014042227d30 bsp=e000014042220d08
[<a0000001007d6000>] acpi_pci_root_init+0x20/0x60
sp=e000014042227d30 bsp=e000014042220cf0
[<a0000001007a46b0>] kernel_init+0x450/0x7c0
sp=e000014042227d30 bsp=e000014042220ca8
[<a000000100012550>] kernel_thread_helper+0x30/0x60
sp=e000014042227e30 bsp=e000014042220c80
[<a0000001000090c0>] start_kernel_thread+0x20/0x40
sp=e000014042227e30 bsp=e000014042220c80
==
Fix kmalloc(0)
Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Index: linux-2.6.22-rc1-mm1/arch/ia64/pci/pci.c
===================================================================
--- linux-2.6.22-rc1-mm1.orig/arch/ia64/pci/pci.c
+++ linux-2.6.22-rc1-mm1/arch/ia64/pci/pci.c
@@ -354,6 +354,8 @@ pci_acpi_scan_root(struct acpi_device *d
acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
&windows);
+ if (!windows)
+ goto out2;
controller->window = kmalloc_node(sizeof(*controller->window) * windows,
GFP_KERNEL, controller->node);
if (!controller->window)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c
2007-05-17 2:00 [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c KAMEZAWA Hiroyuki
@ 2007-05-17 19:19 ` Andrew Morton
2007-05-18 0:48 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-05-17 19:19 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki; +Cc: linux-ia64, LKML, tony.luck
On Thu, 17 May 2007 11:00:56 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> Fix following kmalloc(0) message. patch is agaisnt 2.6.22-rc1-mm1.
>
> ==
> BUG: at mm/slab.c:792 __find_general_cachep()
>
> Call Trace:
> [<a000000100013f20>] show_stack+0x40/0xa0
> sp=e000014042227b00 bsp=e000014042220f90
> [<a000000100013fb0>] dump_stack+0x30/0x60
> sp=e000014042227cd0 bsp=e000014042220f78
> [<a00000010014fe10>] kmem_find_general_cachep+0x90/0x140
> sp=e000014042227cd0 bsp=e000014042220f48
> [<a0000001001504f0>] __kmalloc_node+0x30/0xa0
> sp=e000014042227cd0 bsp=e000014042220f18
> [<a0000001004eb700>] pci_acpi_scan_root+0x180/0x4a0
> sp=e000014042227cd0 bsp=e000014042220ed0
> [<a000000100361140>] acpi_pci_root_add+0x4e0/0x700
> sp=e000014042227cf0 bsp=e000014042220e90
> [<a00000010035b240>] acpi_device_probe+0xa0/0x160
> sp=e000014042227d10 bsp=e000014042220e58
> [<a0000001003e4550>] driver_probe_device+0x250/0x380
> sp=e000014042227d10 bsp=e000014042220e18
> [<a0000001003e4900>] __driver_attach+0xc0/0x160
> sp=e000014042227d10 bsp=e000014042220de0
> [<a0000001003e2980>] bus_for_each_dev+0x80/0x100
> sp=e000014042227d10 bsp=e000014042220da8
> [<a0000001003e4120>] driver_attach+0x40/0x60
> sp=e000014042227d30 bsp=e000014042220d88
> [<a0000001003e3170>] bus_add_driver+0xf0/0x3c0
> sp=e000014042227d30 bsp=e000014042220d48
> [<a0000001003e4e00>] driver_register+0x140/0x160
> sp=e000014042227d30 bsp=e000014042220d28
> [<a00000010035ded0>] acpi_bus_register_driver+0x50/0x80
> sp=e000014042227d30 bsp=e000014042220d08
> [<a0000001007d6000>] acpi_pci_root_init+0x20/0x60
> sp=e000014042227d30 bsp=e000014042220cf0
> [<a0000001007a46b0>] kernel_init+0x450/0x7c0
> sp=e000014042227d30 bsp=e000014042220ca8
> [<a000000100012550>] kernel_thread_helper+0x30/0x60
> sp=e000014042227e30 bsp=e000014042220c80
> [<a0000001000090c0>] start_kernel_thread+0x20/0x40
> sp=e000014042227e30 bsp=e000014042220c80
> ==
>
> Fix kmalloc(0)
>
> Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> Index: linux-2.6.22-rc1-mm1/arch/ia64/pci/pci.c
> ===================================================================
> --- linux-2.6.22-rc1-mm1.orig/arch/ia64/pci/pci.c
> +++ linux-2.6.22-rc1-mm1/arch/ia64/pci/pci.c
> @@ -354,6 +354,8 @@ pci_acpi_scan_root(struct acpi_device *d
>
> acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
> &windows);
> + if (!windows)
> + goto out2;
> controller->window = kmalloc_node(sizeof(*controller->window) * windows,
> GFP_KERNEL, controller->node);
> if (!controller->window)
>
This is a significant change in functionality. Can you please explain why
it doesn't break things?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c
2007-05-17 19:19 ` Andrew Morton
@ 2007-05-18 0:48 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 3+ messages in thread
From: KAMEZAWA Hiroyuki @ 2007-05-18 0:48 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-ia64, linux-kernel, tony.luck
On Thu, 17 May 2007 12:19:59 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:
> > + if (!windows)
> > + goto out2;
> > controller->window = kmalloc_node(sizeof(*controller->window) * windows,
> > GFP_KERNEL, controller->node);
> > if (!controller->window)
> >
>
> This is a significant change in functionality. Can you please explain why
> it doesn't break things?
>
Sorry for long RTT. I found no problem on my machine, but....
I realized I misunderstood how kmalloc(0) works....sorry, please drop patch.
I'll ask a pci guy to fix this.
-Kame
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-18 0:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-17 2:00 [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c KAMEZAWA Hiroyuki
2007-05-17 19:19 ` Andrew Morton
2007-05-18 0:48 ` KAMEZAWA Hiroyuki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome