diff options
author | Navid Emamdoost <navid.emamdoost@gmail.com> | 2019-09-25 06:20:34 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2019-10-18 22:11:54 +0300 |
commit | c8c2a057fdc7de1cd16f4baa51425b932a42eb39 (patch) | |
tree | a81f76765da19f707e69631bd285695441a6f805 /drivers/net | |
parent | 61ea02d2c13106116c6e4916ac5d9dd41151c959 (diff) | |
download | linux-c8c2a057fdc7de1cd16f4baa51425b932a42eb39.tar.xz |
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: 537a50574175 ("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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c | 4 |
1 files changed, 3 insertions, 1 deletions
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)); |