net/mlx5: prevent memory leak in mlx5_fpga_conn_create_cq
Subsystems (5)
PATCH 1/1 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.
Signed-off-by Navid Emamdoost <[email protected]>
--- drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +3 -1
@@ -464,8 +464,10 @@ static int mlx5_fpga_conn_create_cq(struct mlx5_fpga_conn *conn, int cq_size) } err =mlx5_vector2eqn (mdev,smp_processor_id (), &eqn, &irqn); -if (err) +if (err) { +kvfree (in); goto err_cqwq; + } cqc =MLX5_ADDR_OF (create_cq_in, in, cq_context);MLX5_SET (cqc, cqc, log_cq_size,ilog2 (cq_size));
Signature · 1 line
2.17.1
David Miller
maintainerFrom: Navid Emamdoost <[email protected]>
Date: Tue, 24 Sep 2019 22:20:34 -0500
Quoted 4 lines
In
mlx5_fpga_conn_create_cqifmlx5_vector2eqnfails the allocated memory should be released.Signed-off-by Navid Emamdoost <[email protected]>
Saeed, please queue this up.
Saeed Mahameed
AppliedQuoted 9 lines · David Miller
From: Navid Emamdoost <[email protected]>
Date: Tue, 24 Sep 2019 22:20:34 -0500Quoted 4 lines
In
mlx5_fpga_conn_create_cqifmlx5_vector2eqnfails the allocated memory should be released.Signed-off-by Navid Emamdoost <[email protected]>Saeed, please queue this up.
Applied to net-mlx5 branch will send it to net branch shortly.