Skip to content

Commit c8c2a05

Browse files
NavidemSaeed Mahameed
authored and
Saeed Mahameed
committed
net/mlx5: prevent memory leak in mlx5_fpga_conn_create_cq
In mlx5_fpga_conn_create_cq if mlx5_vector2eqn fails the allocated memory should be released. Fixes: 537a505 ("net/mlx5: FPGA, Add high-speed connection routines") Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent 61ea02d commit c8c2a05

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/fpga

1 file changed

+3
-1
lines changed

Diff for: drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,10 @@ static int mlx5_fpga_conn_create_cq(struct mlx5_fpga_conn *conn, int cq_size)
464464
}
465465

466466
err = mlx5_vector2eqn(mdev, smp_processor_id(), &eqn, &irqn);
467-
if (err)
467+
if (err) {
468+
kvfree(in);
468469
goto err_cqwq;
470+
}
469471

470472
cqc = MLX5_ADDR_OF(create_cq_in, in, cq_context);
471473
MLX5_SET(cqc, cqc, log_cq_size, ilog2(cq_size));

0 commit comments

Comments
 (0)