Skip to content

Commit

Permalink
pci: hotplug: pciehp: fix error code path in hpc_power_off_slot
Browse files Browse the repository at this point in the history
Fix the error code path in hpc_power_off_slot().

The Bad DLLP Mask bit must be restored before return.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kenji Kaneshige authored and Greg Kroah-Hartman committed Mar 4, 2008
1 parent 90a1ba0 commit c1ef5cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/pci/hotplug/pciehp_hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,8 @@ static int hpc_power_off_slot(struct slot * slot)
retval = pcie_write_cmd(slot, slot_cmd, cmd_mask);
if (retval) {
err("%s: Write command failed!\n", __FUNCTION__);
return -1;
retval = -1;
goto out;
}
dbg("%s: SLOTCTRL %x write cmd %x\n",
__FUNCTION__, ctrl->cap_base + SLOTCTRL, slot_cmd);
Expand All @@ -722,7 +723,7 @@ static int hpc_power_off_slot(struct slot * slot)
* removed from the slot/adapter.
*/
msleep(1000);

out:
if (changed)
pcie_unmask_bad_dllp(ctrl);

Expand Down

0 comments on commit c1ef5cb

Please sign in to comment.