amd-xgbe: Don't overwrite SFP PHY mod_absent settings
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Tue, 28 Feb 2017 21:03:10 +0000 (15:03 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Mar 2017 20:57:53 +0000 (12:57 -0800)
If an SFP module is not present, xgbe_phy_sfp_phy_settings() should
return after applying the default settings. Currently there is no return
statement and the default settings are overwritten.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

index 04804cbb7dc1cd694567667074900e90ae3c6768..e707c49cc55a785f9950685f73c03932a1117541 100644 (file)
@@ -716,6 +716,8 @@ static void xgbe_phy_sfp_phy_settings(struct xgbe_prv_data *pdata)
                pdata->phy.duplex = DUPLEX_UNKNOWN;
                pdata->phy.autoneg = AUTONEG_ENABLE;
                pdata->phy.advertising = pdata->phy.supported;
+
+               return;
        }
 
        pdata->phy.advertising &= ~ADVERTISED_Autoneg;