From: Steven La Date: Sat, 24 Aug 2013 00:19:37 +0000 (-0700) Subject: e1000e: balance semaphore put/get for 82573 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=35fdb94b453bc69b7bc74b717f1e03d41d4bcdba;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git e1000e: balance semaphore put/get for 82573 Steven (cc-ed) noticed an imbalance in semaphore put/get for 82573-based NICs. Don't we need something like the following (untested) patch? Signed-off-by: Steven La Acked-by: Arthur Kepner Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c index 104fcec86af3..8fed74e3fa53 100644 --- a/drivers/net/ethernet/intel/e1000e/82571.c +++ b/drivers/net/ethernet/intel/e1000e/82571.c @@ -1011,6 +1011,11 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) /* Must release MDIO ownership and mutex after MAC reset. */ switch (hw->mac.type) { + case e1000_82573: + /* Release mutex only if the hw semaphore is acquired */ + if (!ret_val) + e1000_put_hw_semaphore_82573(hw); + break; case e1000_82574: case e1000_82583: /* Release mutex only if the hw semaphore is acquired */