From 2a9ef8e1a856be8e526bb9b10fb98c5012f6e3f8 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Wed, 18 Mar 2009 16:36:25 +0800 Subject: ACPI: suspend: Add the Pansonic CF51 box to the dmi check table The Pansonic CF51-2L requires "acpi_sleep=old_ordering", so invoke it automatically via DMI. http://bugzilla.kernel.org/show_bug.cgi?id=12561 Signed-off-by: Zhao Yakui Signed-off-by: Len Brown --- drivers/acpi/sleep.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/acpi') diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 00456fccfa38..31ff2a9a03d7 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -394,6 +394,15 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L300"), }, }, + { + .callback = init_old_suspend_ordering, + .ident = "Panasonic CF51-2L", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, + "Matsushita Electric Industrial Co.,Ltd."), + DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), + }, + }, {}, }; #endif /* CONFIG_SUSPEND */ -- cgit v1.2.3 From 53af9cfb37af5e03ee2b24c5d5c4963c34e5b765 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sun, 15 Mar 2009 23:36:38 -0400 Subject: ACPI: get_throttling_state() cannot be larger than state_count Reported-by: Roel Kluin Acked-by: Zhao Yakui Signed-off-by: Len Brown --- drivers/acpi/processor_throttling.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index d27838171f4a..5f099012f471 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -783,11 +783,9 @@ static int acpi_get_throttling_state(struct acpi_processor *pr, (struct acpi_processor_tx_tss *)&(pr->throttling. states_tss[i]); if (tx->control == value) - break; + return i; } - if (i > pr->throttling.state_count) - i = -1; - return i; + return -1; } static int acpi_get_throttling_value(struct acpi_processor *pr, -- cgit v1.2.3 From f240729832dff3785104d950dad2d3ced4387f6d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 2 Apr 2009 08:29:56 +0300 Subject: dock: fix dereference after kfree() dock_remove() calls kfree() on dock_station so we should use list_for_each_entry_safe() to avoid dereferencing freed memory. Found by smatch (http://repo.or.cz/w/smatch.git/). Compile tested. Signed-off-by: Dan Carpenter Signed-off-by: Len Brown --- drivers/acpi/dock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 35094f230b1e..8f62fa01a9c7 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -1146,9 +1146,10 @@ static int __init dock_init(void) static void __exit dock_exit(void) { struct dock_station *dock_station; + struct dock_station *tmp; unregister_acpi_bus_notifier(&dock_acpi_notifier); - list_for_each_entry(dock_station, &dock_stations, sibiling) + list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibiling) dock_remove(dock_station); } -- cgit v1.2.3 From 609d4bc949a9175a6c8ba9dc1b6fdb4d9dab0427 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 12 Mar 2009 11:58:25 +0000 Subject: ACPI: constify tables in pci_irq.c Signed-off-by: Jan Beulich Signed-off-by: Len Brown --- drivers/acpi/pci_irq.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 891bdf6679f3..f93667ee43dc 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -86,7 +86,7 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(struct pci_dev *dev, } /* http://bugzilla.kernel.org/show_bug.cgi?id=4773 */ -static struct dmi_system_id medion_md9580[] = { +static const struct dmi_system_id medion_md9580[] = { { .ident = "Medion MD9580-F laptop", .matches = { @@ -98,7 +98,7 @@ static struct dmi_system_id medion_md9580[] = { }; /* http://bugzilla.kernel.org/show_bug.cgi?id=5044 */ -static struct dmi_system_id dell_optiplex[] = { +static const struct dmi_system_id dell_optiplex[] = { { .ident = "Dell Optiplex GX1", .matches = { @@ -110,7 +110,7 @@ static struct dmi_system_id dell_optiplex[] = { }; /* http://bugzilla.kernel.org/show_bug.cgi?id=10138 */ -static struct dmi_system_id hp_t5710[] = { +static const struct dmi_system_id hp_t5710[] = { { .ident = "HP t5710", .matches = { @@ -123,13 +123,13 @@ static struct dmi_system_id hp_t5710[] = { }; struct prt_quirk { - struct dmi_system_id *system; + const struct dmi_system_id *system; unsigned int segment; unsigned int bus; unsigned int device; unsigned char pin; - char *source; /* according to BIOS */ - char *actual_source; + const char *source; /* according to BIOS */ + const char *actual_source; }; #define PCI_INTX_PIN(c) (c - 'A' + 1) @@ -139,7 +139,7 @@ struct prt_quirk { * interrupt at the listed segment/bus/device/pin is connected to the first * link device, but it is actually connected to the second. */ -static struct prt_quirk prt_quirks[] = { +static const struct prt_quirk prt_quirks[] = { { medion_md9580, 0, 0, 9, PCI_INTX_PIN('A'), "\\_SB_.PCI0.ISA_.LNKA", "\\_SB_.PCI0.ISA_.LNKB"}, @@ -155,7 +155,7 @@ static void do_prt_fixups(struct acpi_prt_entry *entry, struct acpi_pci_routing_table *prt) { int i; - struct prt_quirk *quirk; + const struct prt_quirk *quirk; for (i = 0; i < ARRAY_SIZE(prt_quirks); i++) { quirk = &prt_quirks[i]; -- cgit v1.2.3