summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/manage.c
diff options
context:
space:
mode:
authorDavid Ertman <david.m.ertman@intel.com>2014-07-09 16:07:42 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-07-25 20:51:00 -0700
commit491a04d2812b0a665bda34ea39875833dc7a1aaf (patch)
treedccfd1e8134272c43c712d10f7f83ebadce1b1de /drivers/net/ethernet/intel/e1000e/manage.c
parent493004d04f56fd7d642bdbb2938e17e5f7d622d1 (diff)
downloadlinux-491a04d2812b0a665bda34ea39875833dc7a1aaf.tar.bz2
e1000e: Add code to check return values on NVM accesses
Adding code to check and respond to previously ignored return values from NVM access functions. Issue discovered through static analysis. Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/manage.c')
-rw-r--r--drivers/net/ethernet/intel/e1000e/manage.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/manage.c b/drivers/net/ethernet/intel/e1000e/manage.c
index cb37ff1f1321..58856032298d 100644
--- a/drivers/net/ethernet/intel/e1000e/manage.c
+++ b/drivers/net/ethernet/intel/e1000e/manage.c
@@ -327,9 +327,12 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
} else if ((hw->mac.type == e1000_82574) ||
(hw->mac.type == e1000_82583)) {
u16 data;
+ s32 ret_val;
factps = er32(FACTPS);
- e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
+ ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
+ if (ret_val)
+ return false;
if (!(factps & E1000_FACTPS_MNGCG) &&
((data & E1000_NVM_INIT_CTRL2_MNGM) ==