Unverified Commit 43b0b6d3 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8366 net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()

parents ae775c90 e25fe30a
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -2279,9 +2279,14 @@ int mlx4_en_try_alloc_resources(struct mlx4_en_priv *priv,
				bool carry_xdp_prog)
{
	struct bpf_prog *xdp_prog;
	int i, t;
	int i, t, ret;

	mlx4_en_copy_priv(tmp, priv, prof);
	ret = mlx4_en_copy_priv(tmp, priv, prof);
	if (ret) {
		en_warn(priv, "%s: mlx4_en_copy_priv() failed, return\n",
			__func__);
		return ret;
	}

	if (mlx4_en_alloc_resources(tmp)) {
		en_warn(priv,