Skip to content

Commit

Permalink
RDMA/nes: Fix incorrect unlock in nes_process_mac_intr()
Browse files Browse the repository at this point in the history
Commit ce6e74f ("RDMA/nes: Make nesadapter->phy_lock usage
consistent") introduced a problem where phy_lock was only unlocked
within an if statement and so nes_process_mac_intr() could return with
phy_lock still held.  Fix this.

This was discovered because of the sparse warning:

    drivers/infiniband/hw/nes/nes_hw.c:2643:9: warning: context imbalance in 'nes_process_mac_intr' - different lock contexts for basic block

Reported-by: Roland Dreier <rdreier@cisco.com>
Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Chien Tung authored and Roland Dreier committed May 25, 2010
1 parent df02902 commit b17e096
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/infiniband/hw/nes/nes_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2584,7 +2584,6 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
break;
}
}
spin_unlock_irqrestore(&nesadapter->phy_lock, flags);

if (phy_data & 0x0004) {
if (wide_ppm_offset &&
Expand Down Expand Up @@ -2639,6 +2638,8 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
}
}

spin_unlock_irqrestore(&nesadapter->phy_lock, flags);

nesadapter->mac_sw_state[mac_number] = NES_MAC_SW_IDLE;
}

Expand Down

0 comments on commit b17e096

Please sign in to comment.