public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ACPI: Add NULL pointer check in acpi_bus_start
@ 2010-01-29 16:48 Thomas Renninger
  2010-02-01  2:43 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Renninger @ 2010-01-29 16:48 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, kristen.c.accardi

If acpi_bus_add does not return a device and it's passed
to acpi_bus_start, bad things will happen:


BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [<ffffffff8128402d>] acpi_bus_start+0x14/0x24
...
[<ffffffffa008977a>] acpiphp_bus_add+0xba/0x130 [acpiphp]
[<ffffffffa008aa72>] enable_device+0x132/0x2ff [acpiphp]
[<ffffffffa0089b68>] acpiphp_enable_slot+0xb8/0x130 [acpiphp]
[<ffffffffa0089df7>] handle_hotplug_event_func+0x87/0x190 [acpiphp]


Next patch would make this NULL pointer check obsolete, but
better having one more than one missing...

Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: bjorn.helgaas@hp.com
CC: lenb@kernel.org
CC: linux-acpi@vger.kernel.org
CC: kristen.c.accardi@intel.com
CC: stable@kernel.org

---
 drivers/acpi/scan.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6.32-SLE11-SP1/drivers/acpi/scan.c
===================================================================
--- linux-2.6.32-SLE11-SP1.orig/drivers/acpi/scan.c
+++ linux-2.6.32-SLE11-SP1/drivers/acpi/scan.c
@@ -1382,6 +1382,9 @@ int acpi_bus_start(struct acpi_device *d
 {
 	struct acpi_bus_ops ops;
 
+	if (!device)
+		return -EINVAL;
+
 	memset(&ops, 0, sizeof(ops));
 	ops.acpi_op_start = 1;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] ACPI: Add NULL pointer check in acpi_bus_start
  2010-01-29 16:48 [PATCH 1/2] ACPI: Add NULL pointer check in acpi_bus_start Thomas Renninger
@ 2010-02-01  2:43 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2010-02-01  2:43 UTC (permalink / raw)
  To: Thomas Renninger; +Cc: linux-acpi, kristen.c.accardi

applied

thanks,
Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-01  2:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-29 16:48 [PATCH 1/2] ACPI: Add NULL pointer check in acpi_bus_start Thomas Renninger
2010-02-01  2:43 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox