e1000e: e1000e_enable_tx_pkt_filtering() returns wrong value

e1000e_enable_tx_pkt_filtering() will return a non-zero value if the
driver fails to enable the manageability interface on the host for
any reason; instead it should retun zero to indicate filtering has been
disabled. Also provide a single exit point for the function.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Bruce Allan and committed by David S. Miller ca777f9c f464ba87

+9 -7
+9 -7
drivers/net/e1000e/lib.c
··· 2301 2301 s32 ret_val, hdr_csum, csum; 2302 2302 u8 i, len; 2303 2303 2304 + hw->mac.tx_pkt_filtering = true; 2305 + 2304 2306 /* No manageability, no filtering */ 2305 2307 if (!e1000e_check_mng_mode(hw)) { 2306 2308 hw->mac.tx_pkt_filtering = false; 2307 - return 0; 2309 + goto out; 2308 2310 } 2309 2311 2310 2312 /* ··· 2314 2312 * reason, disable filtering. 2315 2313 */ 2316 2314 ret_val = e1000_mng_enable_host_if(hw); 2317 - if (ret_val != 0) { 2315 + if (ret_val) { 2318 2316 hw->mac.tx_pkt_filtering = false; 2319 - return ret_val; 2317 + goto out; 2320 2318 } 2321 2319 2322 2320 /* Read in the header. Length and offset are in dwords. */ ··· 2335 2333 */ 2336 2334 if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) { 2337 2335 hw->mac.tx_pkt_filtering = true; 2338 - return 1; 2336 + goto out; 2339 2337 } 2340 2338 2341 2339 /* Cookie area is valid, make the final check for filtering. */ 2342 2340 if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) { 2343 2341 hw->mac.tx_pkt_filtering = false; 2344 - return 0; 2342 + goto out; 2345 2343 } 2346 2344 2347 - hw->mac.tx_pkt_filtering = true; 2348 - return 1; 2345 + out: 2346 + return hw->mac.tx_pkt_filtering; 2349 2347 } 2350 2348 2351 2349 /**