summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-09-14 10:23:13 +0200
committerDavid S. Miller <davem@davemloft.net>2009-09-15 02:03:54 +0200
commitd314737ad3bad6b4603b243fd6db572385259690 (patch)
treeaeb1403dff45df771e0c83bad4e7d8c6b8164e50
parentigb: reset sgmii phy at start of init (diff)
downloadlinux-d314737ad3bad6b4603b243fd6db572385259690.tar.xz
linux-d314737ad3bad6b4603b243fd6db572385259690.zip
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: 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>
-rw-r--r--drivers/net/igb/e1000_phy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
index c1f4da630420..ee460600e74b 100644
--- a/drivers/net/igb/e1000_phy.c
+++ b/drivers/net/igb/e1000_phy.c
@@ -1565,9 +1565,12 @@ out:
**/
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;