Skip to content

Commit

Permalink
[PATCH] acpiphp: turn off slot power at error case
Browse files Browse the repository at this point in the history
When acpiphp_enable_slot() is failed, acpiphp does not change
the slot->flags. Therefore, when user tries to read power
status, acpiphp_get_power_status() returns the enable status
whether the slot is not really enabled.

This patch fixes this BUG.

Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
MUNEDA Takahiro authored and Greg Kroah-Hartman committed Jun 19, 2006
1 parent c144247 commit cde0e5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,9 +1592,15 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
if (retval)
goto err_exit;

if (get_slot_status(slot) == ACPI_STA_ALL)
if (get_slot_status(slot) == ACPI_STA_ALL) {
/* configure all functions */
retval = enable_device(slot);
if (retval)
power_off_slot(slot);
} else {
dbg("%s: Slot status is not ACPI_STA_ALL\n", __FUNCTION__);
power_off_slot(slot);
}

err_exit:
mutex_unlock(&slot->crit_sect);
Expand Down

0 comments on commit cde0e5d

Please sign in to comment.