From: Dima Ruinskiy <dima.ruins...@intel.com> Static analysis has reported that when there is no get link status callback function, the value set in the if condition is not used and gets overwritten in the "out" section of the code. Fix by not seting the variable.
Signed-off-by: Dima Ruinskiy <dima.ruins...@intel.com> Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com> --- drivers/net/intel/e1000/base/e1000_i225.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/intel/e1000/base/e1000_i225.c b/drivers/net/intel/e1000/base/e1000_i225.c index 611f3e8408..ed4ac25a1c 100644 --- a/drivers/net/intel/e1000/base/e1000_i225.c +++ b/drivers/net/intel/e1000/base/e1000_i225.c @@ -1025,10 +1025,8 @@ s32 e1000_check_for_link_i225(struct e1000_hw *hw) * changed. The get_link_status flag is set upon receiving * a Link Status Change or Rx Sequence Error interrupt. */ - if (!mac->get_link_status) { - ret_val = E1000_SUCCESS; + if (!mac->get_link_status) goto out; - } /* First we want to see if the MII Status Register reports * link. If so, then we want to get the current speed/duplex -- 2.43.5