Skip to content

Commit 5c53c12

Browse files
Michal Swiatkowskianguy11
authored andcommitted
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: Przemek Kitszel <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 7c37bf9 commit 5c53c12

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/net/ethernet/intel/ice/ice_repr.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,16 +355,16 @@ static int ice_repr_add(struct ice_vf *vf)
355355
*/
356356
static void ice_repr_rem(struct ice_vf *vf)
357357
{
358-
if (!vf->repr)
358+
struct ice_repr *repr = vf->repr;
359+
360+
if (!repr)
359361
return;
360362

361-
kfree(vf->repr->q_vector);
362-
vf->repr->q_vector = NULL;
363-
unregister_netdev(vf->repr->netdev);
363+
kfree(repr->q_vector);
364+
unregister_netdev(repr->netdev);
364365
ice_devlink_destroy_vf_port(vf);
365-
free_netdev(vf->repr->netdev);
366-
vf->repr->netdev = NULL;
367-
kfree(vf->repr);
366+
free_netdev(repr->netdev);
367+
kfree(repr);
368368
vf->repr = NULL;
369369

370370
ice_virtchnl_set_dflt_ops(vf);

0 commit comments

Comments
 (0)