From: Linus Torvalds Date: Sun, 16 Nov 2008 18:09:34 +0000 (-0800) Subject: acpi: fix oops in acpi_system_wakeup_device_seq_show X-Git-Tag: v2.6.28-rc6~66 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=77fb61a04a0483ad274ce5c51b02c46c12db3693;p=linux-2.6-omap-h63xx.git acpi: fix oops in acpi_system_wakeup_device_seq_show Commit 0794469da3f7b2093575cbdfc1108308dd3641ce: ("ACPI: struct device - replace bus_id with dev_name(), dev_set_name()") introduced a bug by testing 'dev_name(ldev)' instead of 'ldev->bus' for NULL when printing out the bus information. So if ldev->bus was NULL, we'd oops. Reported-and-tested-by: Bruno Prémont Cc: Kay Sievers Cc: Len Brown Cc: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index 64e591ba86f..4dbc2271acf 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c @@ -366,7 +366,7 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) dev->wakeup.state.enabled ? "enabled" : "disabled"); if (ldev) seq_printf(seq, "%s:%s", - dev_name(ldev) ? ldev->bus->name : "no-bus", + ldev->bus ? ldev->bus->name : "no-bus", dev_name(ldev)); seq_printf(seq, "\n"); put_device(ldev);