Skip to content

Commit

Permalink
igb: do not allow phy sw reset code to make calls to null pointers
Browse files Browse the repository at this point in the history
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: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Sep 15, 2009
1 parent 2fb02a2 commit d314737
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/igb/e1000_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d314737

Please sign in to comment.