aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorAndy Gospodarek <andy@greyhouse.net>2011-02-17 04:13:13 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-02-17 04:13:13 -0500
commit4c7e604babd15db9dca3b07de167a0f93fe23bf4 (patch)
tree7bd44f17d5760d938bdd6802c8c3be64f9264749 /drivers/net/ixgbe
parent713b3c9e4c1a6da6b45da6474ed554ed0a48de69 (diff)
ixgbe: fix panic due to uninitialised pointer
Systems containing an 82599EB and running a backported driver from upstream were panicing on boot. It turns out hw->mac.ops.setup_sfp is only set for 82599, so one should check to be sure that pointer is set before continuing in ixgbe_sfp_config_module_task. I verified by inspection that the upstream driver has the same issue and also added a check before the call in ixgbe_sfp_link_config. Signed-off-by: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index fbae703b46d7..30f9ccfb4f87 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3728,7 +3728,8 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter)
3728 * We need to try and force an autonegotiation 3728 * We need to try and force an autonegotiation
3729 * session, then bring up link. 3729 * session, then bring up link.
3730 */ 3730 */
3731 hw->mac.ops.setup_sfp(hw); 3731 if (hw->mac.ops.setup_sfp)
3732 hw->mac.ops.setup_sfp(hw);
3732 if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK)) 3733 if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK))
3733 schedule_work(&adapter->multispeed_fiber_task); 3734 schedule_work(&adapter->multispeed_fiber_task);
3734 } else { 3735 } else {
@@ -5968,7 +5969,8 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work)
5968 unregister_netdev(adapter->netdev); 5969 unregister_netdev(adapter->netdev);
5969 return; 5970 return;
5970 } 5971 }
5971 hw->mac.ops.setup_sfp(hw); 5972 if (hw->mac.ops.setup_sfp)
5973 hw->mac.ops.setup_sfp(hw);
5972 5974
5973 if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK)) 5975 if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK))
5974 /* This will also work for DA Twinax connections */ 5976 /* This will also work for DA Twinax connections */