Skip to content

Commit 4c7e604

Browse files
gospoJeff Kirsher
authored andcommitted
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>
1 parent 713b3c9 commit 4c7e604

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ixgbe/ixgbe_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3728,7 +3728,8 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter)
37283728
* We need to try and force an autonegotiation
37293729
* session, then bring up link.
37303730
*/
3731-
hw->mac.ops.setup_sfp(hw);
3731+
if (hw->mac.ops.setup_sfp)
3732+
hw->mac.ops.setup_sfp(hw);
37323733
if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK))
37333734
schedule_work(&adapter->multispeed_fiber_task);
37343735
} else {
@@ -5968,7 +5969,8 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work)
59685969
unregister_netdev(adapter->netdev);
59695970
return;
59705971
}
5971-
hw->mac.ops.setup_sfp(hw);
5972+
if (hw->mac.ops.setup_sfp)
5973+
hw->mac.ops.setup_sfp(hw);
59725974

59735975
if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK))
59745976
/* This will also work for DA Twinax connections */

0 commit comments

Comments
 (0)