From: Chien Tung Date: Tue, 25 May 2010 15:13:09 +0000 (-0500) Subject: RDMA/nes: Fix incorrect unlock in nes_process_mac_intr() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b17e0969dc184c66ed8934e130344621829484a3;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Chien Tung Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index bb9c77504fe2..57874a165083 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c @@ -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 && @@ -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; }