Skip to content

Commit

Permalink
ice: Change ice_vsi_realloc_stat_arrays() to void
Browse files Browse the repository at this point in the history
smatch reports:

smatch warnings:
drivers/net/ethernet/intel/ice/ice_lib.c:3612 ice_vsi_rebuild() warn: missing error code 'ret'

If an error is encountered for ice_vsi_realloc_stat_arrays(), ret is not
assigned an error value so the goto error path would return success. The
function, however, only returns 0 so an error will never be reported; due
to this, change the function to return void.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
  • Loading branch information
Tony Nguyen committed Feb 14, 2023
1 parent fce92db commit d8a23ff
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/net/ethernet/intel/ice/ice_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3426,17 +3426,17 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi,
* @prev_txq: Number of Tx rings before ring reallocation
* @prev_rxq: Number of Rx rings before ring reallocation
*/
static int
static void
ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi, int prev_txq, int prev_rxq)
{
struct ice_vsi_stats *vsi_stat;
struct ice_pf *pf = vsi->back;
int i;

if (!prev_txq || !prev_rxq)
return 0;
return;
if (vsi->type == ICE_VSI_CHNL)
return 0;
return;

vsi_stat = pf->vsi_stats[vsi->idx];

Expand All @@ -3457,8 +3457,6 @@ ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi, int prev_txq, int prev_rxq)
}
}
}

return 0;
}

/**
Expand Down Expand Up @@ -3515,8 +3513,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
}
}

if (ice_vsi_realloc_stat_arrays(vsi, prev_txq, prev_rxq))
goto err_vsi_cfg_tc_lan;
ice_vsi_realloc_stat_arrays(vsi, prev_txq, prev_rxq);

ice_vsi_rebuild_set_coalesce(vsi, coalesce, prev_num_q_vectors);
kfree(coalesce);
Expand Down

0 comments on commit d8a23ff

Please sign in to comment.