Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d314737a authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller
Browse files

igb: do not allow phy sw reset code to make calls to null pointers



In the case of fiber and serdes adapters we were seeing issues with ethtool
-t causing kernel panics due to null function pointers.  To prevent this we
need to exit out of the phy reset code in the event that we do not have a
valid phy.

Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarDon Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2fb02a26
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1565,9 +1565,12 @@ s32 igb_get_phy_info_igp(struct e1000_hw *hw)
 **/
s32 igb_phy_sw_reset(struct e1000_hw *hw)
{
	s32 ret_val;
	s32 ret_val = 0;
	u16 phy_ctrl;

	if (!(hw->phy.ops.read_reg))
		goto out;

	ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_ctrl);
	if (ret_val)
		goto out;