Commit b17e0969dc184c66ed8934e130344621829484a3
Committed by
Roland Dreier
1 parent
df02902313
Exists in
master
and in
4 other branches
RDMA/nes: Fix incorrect unlock in nes_process_mac_intr()
Commit ce6e74f2 ("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>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
drivers/infiniband/hw/nes/nes_hw.c
... | ... | @@ -2584,7 +2584,6 @@ |
2584 | 2584 | break; |
2585 | 2585 | } |
2586 | 2586 | } |
2587 | - spin_unlock_irqrestore(&nesadapter->phy_lock, flags); | |
2588 | 2587 | |
2589 | 2588 | if (phy_data & 0x0004) { |
2590 | 2589 | if (wide_ppm_offset && |
... | ... | @@ -2638,6 +2637,8 @@ |
2638 | 2637 | } |
2639 | 2638 | } |
2640 | 2639 | } |
2640 | + | |
2641 | + spin_unlock_irqrestore(&nesadapter->phy_lock, flags); | |
2641 | 2642 | |
2642 | 2643 | nesadapter->mac_sw_state[mac_number] = NES_MAC_SW_IDLE; |
2643 | 2644 | } |