diff mbox

ixgbe: always initialize setup_fc

Message ID CAE2NFgXEYU0mJDs638JYzykUSz4PCme6kecXVjWesH=0ySxZVQ@mail.gmail.com
State Superseded
Headers show

Commit Message

Patrick McLean July 2, 2016, 1:31 a.m. UTC
In ixgbe_init_mac_link_ops_X550em, the code has a special case for
backplane media type, but does not fall through to the default case, so the
setup_fc never gets initialized. This causes a panic when it later tries to
set up the card, and the kernel dereferences the null pointer.

This patch lets the the function fall through, which initialized setup_fc
properly.

Comments

Tantilov, Emil S July 11, 2016, 6:41 p.m. UTC | #1
>-----Original Message-----
>From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On
>Behalf Of Patrick McLean
>Sent: Friday, July 01, 2016 6:31 PM
>To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>
>Cc: netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
>Subject: [Intel-wired-lan] [PATCH] ixgbe: always initialize setup_fc
>
>In ixgbe_init_mac_link_ops_X550em, the code has a special case for
>backplane media type, but does not fall through to the default case, so the
>setup_fc never gets initialized. This causes a panic when it later tries to
>set up the card, and the kernel dereferences the null pointer.
>
>This patch lets the the function fall through, which initialized setup_fc
>properly.

Why are you resending this patch? I have already submitted a patch to handle this properly:
http://patchwork.ozlabs.org/patch/646228/

Thanks,
Emil
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index 19b75cd..73e2de7 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -1653,7 +1653,6 @@  static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
 		if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII ||
 		    hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L)
 			mac->ops.setup_link = ixgbe_setup_sgmii;
-		break;
 	default:
 		mac->ops.setup_fc = ixgbe_setup_fc_x550em;
 		break;