Commit 5c53c122 authored by Michal Swiatkowski's avatar Michal Swiatkowski Committed by Tony Nguyen

ice: use repr instead of vf->repr

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: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 7c37bf99
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment