Commit 805f980b authored by Anirudh Venkataramanan's avatar Anirudh Venkataramanan Committed by Tony Nguyen

ice: Check for bail out condition early

Check for bail out condition before calling ice_aq_sff_eeprom
Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 800c1443
......@@ -3926,14 +3926,14 @@ ice_get_module_eeprom(struct net_device *netdev,
u8 value = 0;
u8 page = 0;
status = ice_aq_sff_eeprom(hw, 0, addr, offset, page, 0,
&value, 1, 0, NULL);
if (status)
return -EIO;
if (!ee || !ee->len || !data)
return -EINVAL;
status = ice_aq_sff_eeprom(hw, 0, addr, offset, page, 0, &value, 1, 0,
NULL);
if (status)
return -EIO;
if (value == ICE_MODULE_TYPE_SFP)
is_sfp = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment