Message ID | 20190925032038.22943-1-navid.emamdoost@gmail.com |
---|---|
State | Awaiting Upstream |
Delegated to: | David Miller |
Headers | show |
Series | net/mlx5: prevent memory leak in mlx5_fpga_conn_create_cq | expand |
From: Navid Emamdoost <navid.emamdoost@gmail.com> Date: Tue, 24 Sep 2019 22:20:34 -0500 > In mlx5_fpga_conn_create_cq if mlx5_vector2eqn fails the allocated > memory should be released. > > Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Saeed, please queue this up.
On Fri, 2019-09-27 at 10:33 +0200, David Miller wrote: > From: Navid Emamdoost <navid.emamdoost@gmail.com> > Date: Tue, 24 Sep 2019 22:20:34 -0500 > > > In mlx5_fpga_conn_create_cq if mlx5_vector2eqn fails the allocated > > memory should be released. > > > > Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> > > Saeed, please queue this up. Applied to net-mlx5 branch will send it to net branch shortly.
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c index 4c50efe4e7f1..61021133029e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c @@ -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));
In mlx5_fpga_conn_create_cq if mlx5_vector2eqn fails the allocated memory should be released. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> --- drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)