public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"tony.luck@intel.com" <tony.luck@intel.com>
Subject: Re: [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c
Date: Thu, 17 May 2007 19:19:59 +0000	[thread overview]
Message-ID: <20070517121959.b1b374fa.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070517110056.779944a2.kamezawa.hiroyu@jp.fujitsu.com>

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à00014042227b00 bspà00014042220f90
>  [<a000000100013fb0>] dump_stack+0x30/0x60
>                                 spà00014042227cd0 bspà00014042220f78
>  [<a00000010014fe10>] kmem_find_general_cachep+0x90/0x140
>                                 spà00014042227cd0 bspà00014042220f48
>  [<a0000001001504f0>] __kmalloc_node+0x30/0xa0
>                                 spà00014042227cd0 bspà00014042220f18
>  [<a0000001004eb700>] pci_acpi_scan_root+0x180/0x4a0
>                                 spà00014042227cd0 bspà00014042220ed0
>  [<a000000100361140>] acpi_pci_root_add+0x4e0/0x700
>                                 spà00014042227cf0 bspà00014042220e90
>  [<a00000010035b240>] acpi_device_probe+0xa0/0x160
>                                 spà00014042227d10 bspà00014042220e58
>  [<a0000001003e4550>] driver_probe_device+0x250/0x380
>                                 spà00014042227d10 bspà00014042220e18
>  [<a0000001003e4900>] __driver_attach+0xc0/0x160
>                                 spà00014042227d10 bspà00014042220de0
>  [<a0000001003e2980>] bus_for_each_dev+0x80/0x100
>                                 spà00014042227d10 bspà00014042220da8
>  [<a0000001003e4120>] driver_attach+0x40/0x60
>                                 spà00014042227d30 bspà00014042220d88
>  [<a0000001003e3170>] bus_add_driver+0xf0/0x3c0
>                                 spà00014042227d30 bspà00014042220d48
>  [<a0000001003e4e00>] driver_register+0x140/0x160
>                                 spà00014042227d30 bspà00014042220d28
>  [<a00000010035ded0>] acpi_bus_register_driver+0x50/0x80
>                                 spà00014042227d30 bspà00014042220d08
>  [<a0000001007d6000>] acpi_pci_root_init+0x20/0x60
>                                 spà00014042227d30 bspà00014042220cf0
>  [<a0000001007a46b0>] kernel_init+0x450/0x7c0
>                                 spà00014042227d30 bspà00014042220ca8
>  [<a000000100012550>] kernel_thread_helper+0x30/0x60
>                                 spà00014042227e30 bspà00014042220c80
>  [<a0000001000090c0>] start_kernel_thread+0x20/0x40
>                                 spà00014042227e30 bspà00014042220c80
> =
> 
> 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?


  reply	other threads:[~2007-05-17 19:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-17  2:00 [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c KAMEZAWA Hiroyuki
2007-05-17 19:19 ` Andrew Morton [this message]
2007-05-18  0:48   ` KAMEZAWA Hiroyuki
2007-05-22  1:23 ` Kenji Kaneshige

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070517121959.b1b374fa.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox