Skip to content

Commit

Permalink
i40e: Fix sparse warning: missing error code 'err'
Browse files Browse the repository at this point in the history
commit 8a1e918 upstream.

Set proper return values inside error checking if-statements.

Previously following warning was produced when compiling against sparse.
i40e_main.c:15162 i40e_init_recovery_mode() warn: missing error code 'err'

Fixes: 4ff0ee1 ("i40e: Introduce recovery mode support")
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
kubalewski authored and gregkh committed Apr 14, 2021
1 parent 30261f0 commit 3a1cc64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14647,12 +14647,16 @@ static int i40e_init_recovery_mode(struct i40e_pf *pf, struct i40e_hw *hw)
* in order to register the netdev
*/
v_idx = i40e_vsi_mem_alloc(pf, I40E_VSI_MAIN);
if (v_idx < 0)
if (v_idx < 0) {
err = v_idx;
goto err_switch_setup;
}
pf->lan_vsi = v_idx;
vsi = pf->vsi[v_idx];
if (!vsi)
if (!vsi) {
err = -EFAULT;
goto err_switch_setup;
}
vsi->alloc_queue_pairs = 1;
err = i40e_config_netdev(vsi);
if (err)
Expand Down

0 comments on commit 3a1cc64

Please sign in to comment.