Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a055c19b authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller
Browse files

bpf, mlx5: drop priv->xdp_prog reference on netdev cleanup



mlx5e_xdp_set() is currently the only place where we drop reference on the
prog sitting in priv->xdp_prog when it's exchanged by a new one. We also
need to make sure that we eventually release that reference, for example,
in case the netdev is dismantled, otherwise we leak the program.

Fixes: 86994156 ("net/mlx5e: XDP fast RX drop bpf programs support")
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c54c0629
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3705,6 +3705,9 @@ static void mlx5e_nic_cleanup(struct mlx5e_priv *priv)

	if (MLX5_CAP_GEN(mdev, vport_group_manager))
		mlx5_eswitch_unregister_vport_rep(esw, 0);

	if (priv->xdp_prog)
		bpf_prog_put(priv->xdp_prog);
}

static int mlx5e_init_nic_rx(struct mlx5e_priv *priv)