From 81203d44e096a7f4963e83bdfaa34031db772a15 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Fri, 1 Aug 2008 15:58:17 -0600 Subject: [PATCH] --- yaml --- r: 108502 b: refs/heads/master c: fa46d3526461e8aa7c0fb39cc1b98ac656695a43 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/acpi/dock.c | 11 +++-------- trunk/drivers/acpi/pci_link.c | 12 +++++++----- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 4705660ec5ea..cb4137f1bc37 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: afd7301ddb762b66bf1831b0820b402e5d2c439d +refs/heads/master: fa46d3526461e8aa7c0fb39cc1b98ac656695a43 diff --git a/trunk/drivers/acpi/dock.c b/trunk/drivers/acpi/dock.c index 7d2edf143f16..bb7c51f712bd 100644 --- a/trunk/drivers/acpi/dock.c +++ b/trunk/drivers/acpi/dock.c @@ -563,6 +563,9 @@ EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device); */ static int handle_eject_request(struct dock_station *ds, u32 event) { + if (!dock_present(ds)) + return -ENODEV; + if (dock_in_progress(ds)) return -EBUSY; @@ -570,16 +573,8 @@ static int handle_eject_request(struct dock_station *ds, u32 event) * here we need to generate the undock * event prior to actually doing the undock * so that the device struct still exists. - * Also, even send the dock event if the - * device is not present anymore */ dock_event(ds, event, UNDOCK_EVENT); - - if (!dock_present(ds)) { - complete_undock(ds); - return -ENODEV; - } - hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST); undock(ds); eject_dock(ds); diff --git a/trunk/drivers/acpi/pci_link.c b/trunk/drivers/acpi/pci_link.c index 89f3b2abfdc7..cf47805a7448 100644 --- a/trunk/drivers/acpi/pci_link.c +++ b/trunk/drivers/acpi/pci_link.c @@ -849,7 +849,7 @@ static int __init acpi_irq_penalty_update(char *str, int used) if (irq < 0) continue; - if (irq >= ACPI_MAX_IRQS) + if (irq >= ARRAY_SIZE(acpi_irq_penalty)) continue; if (used) @@ -872,10 +872,12 @@ static int __init acpi_irq_penalty_update(char *str, int used) */ void acpi_penalize_isa_irq(int irq, int active) { - if (active) - acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED; - else - acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; + if (irq >= 0 && irq < ARRAY_SIZE(acpi_irq_penalty)) { + if (active) + acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED; + else + acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; + } } /*