From: Dima Ruinskiy <[email protected]>

Currently, when writing GPY PHY registers, semaphor is acquired before
writing. However, if writing fails, semaphor is not released, causing
a deadlock down the line. Fix the issue by removing premature return.

Fixes: 8cb7c57d9b3c ("net/igc: support device initialization")
Cc: [email protected]

Signed-off-by: Dima Ruinskiy <[email protected]>
Signed-off-by: Anatoly Burakov <[email protected]>
---
 .mailmap                             | 1 +
 drivers/net/intel/igc/base/igc_phy.c | 4 ----
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/.mailmap b/.mailmap
index 9209a716e0..3faff80f0e 100644
--- a/.mailmap
+++ b/.mailmap
@@ -358,6 +358,7 @@ Dhruv Tripathi <[email protected]>
 Diana Wang <[email protected]>
 Didier Pallard <[email protected]>
 Dilshod Urazov <[email protected]>
+Dima Ruinskiy <[email protected]>
 Ding Zhi <[email protected]>
 Diogo Behrens <[email protected]>
 Dirk-Holger Lenz <[email protected]>
diff --git a/drivers/net/intel/igc/base/igc_phy.c 
b/drivers/net/intel/igc/base/igc_phy.c
index 2906bae21a..ddc2b6ecc1 100644
--- a/drivers/net/intel/igc/base/igc_phy.c
+++ b/drivers/net/intel/igc/base/igc_phy.c
@@ -4148,8 +4148,6 @@ s32 igc_write_phy_reg_gpy(struct igc_hw *hw, u32 offset, 
u16 data)
                if (ret_val)
                        return ret_val;
                ret_val = igc_write_phy_reg_mdic(hw, offset, data);
-               if (ret_val)
-                       return ret_val;
                hw->phy.ops.release(hw);
        } else {
                ret_val = igc_write_xmdio_reg(hw, (u16)offset, dev_addr,
@@ -4182,8 +4180,6 @@ s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, 
u16 *data)
                if (ret_val)
                        return ret_val;
                ret_val = igc_read_phy_reg_mdic(hw, offset, data);
-               if (ret_val)
-                       return ret_val;
                hw->phy.ops.release(hw);
        } else {
                ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr,
-- 
2.43.5

Reply via email to