[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090914182312.4859.21938.stgit@localhost.localdomain>
Date: Mon, 14 Sep 2009 11:23:13 -0700
From: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, gospo@...hat.com,
Alexander Duyck <alexander.h.duyck@...el.com>,
Don Skidmore <donald.c.skidmore@...el.com>
Subject: [net-next PATCH 2/2] igb: do not allow phy sw reset code to make
calls to null pointers
From: Alexander Duyck <alexander.h.duyck@...el.com>
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@...el.com>
Signed-off-by: Don Skidmore <donald.c.skidmore@...el.com>
---
drivers/net/igb/e1000_phy.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
index c1f4da6..ee46060 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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists