Skip to content

Commit

Permalink
ice: use repr instead of vf->repr
Browse files Browse the repository at this point in the history
Extract repr from vf->repr as it is often use in the ice_repr_rem().

Remove meaningless clearing of q_vector and netdev pointers as kfree is
called on repr pointer.

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Michal Swiatkowski authored and Tony Nguyen committed Nov 13, 2023
1 parent 7c37bf9 commit 5c53c12
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/net/ethernet/intel/ice/ice_repr.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,16 +355,16 @@ static int ice_repr_add(struct ice_vf *vf)
*/
static void ice_repr_rem(struct ice_vf *vf)
{
if (!vf->repr)
struct ice_repr *repr = vf->repr;

if (!repr)
return;

kfree(vf->repr->q_vector);
vf->repr->q_vector = NULL;
unregister_netdev(vf->repr->netdev);
kfree(repr->q_vector);
unregister_netdev(repr->netdev);
ice_devlink_destroy_vf_port(vf);
free_netdev(vf->repr->netdev);
vf->repr->netdev = NULL;
kfree(vf->repr);
free_netdev(repr->netdev);
kfree(repr);
vf->repr = NULL;

ice_virtchnl_set_dflt_ops(vf);
Expand Down

0 comments on commit 5c53c12

Please sign in to comment.