提交 48eb5b9c 编写于 作者: D Daniel Borkmann 提交者: David S. Miller

ixgbe: phy: fix uninitialized status in ixgbe_setup_phy_link_tnx

Status variable is never initialized, can carry an arbitrary value
on the stack and thus may let the function fail.

Fixes: e90dd264 ("ixgbe: Make return values more direct")
Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
Acked-by: NEmil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 79ce0477
...@@ -635,7 +635,6 @@ s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, ixgbe_link_speed *speed, ...@@ -635,7 +635,6 @@ s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
**/ **/
s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw) s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
{ {
s32 status;
u16 autoneg_reg = IXGBE_MII_AUTONEG_REG; u16 autoneg_reg = IXGBE_MII_AUTONEG_REG;
bool autoneg = false; bool autoneg = false;
ixgbe_link_speed speed; ixgbe_link_speed speed;
...@@ -700,8 +699,7 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw) ...@@ -700,8 +699,7 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
hw->phy.ops.write_reg(hw, MDIO_CTRL1, hw->phy.ops.write_reg(hw, MDIO_CTRL1,
MDIO_MMD_AN, autoneg_reg); MDIO_MMD_AN, autoneg_reg);
return 0;
return status;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册