diff options
author | Thomas Renninger <trenn@suse.de> | 2010-01-29 11:48:51 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-01-31 21:43:04 -0500 |
commit | d2f6650a950dadd20667a04a9dc785f240d43695 (patch) | |
tree | 6ad17e1824dded4a114fd8b3be1f3024fc88da74 /drivers/acpi | |
parent | abe94c756c08d50566c09a65b9c7fe72f83071c5 (diff) |
ACPI: Add NULL pointer check in acpi_bus_start
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>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: stable@kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/scan.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index ff9f6226085d..8044583f3034 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -1357,6 +1357,9 @@ int acpi_bus_start(struct acpi_device *device) | |||
1357 | { | 1357 | { |
1358 | struct acpi_bus_ops ops; | 1358 | struct acpi_bus_ops ops; |
1359 | 1359 | ||
1360 | if (!device) | ||
1361 | return -EINVAL; | ||
1362 | |||
1360 | memset(&ops, 0, sizeof(ops)); | 1363 | memset(&ops, 0, sizeof(ops)); |
1361 | ops.acpi_op_start = 1; | 1364 | ops.acpi_op_start = 1; |
1362 | 1365 | ||