net/mlx5: DR, Fix freeing in dr_create_rc_qp()
authorDenis Efremov <efremov@linux.com>
Mon, 1 Jun 2020 16:45:26 +0000 (19:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:50:49 +0000 (17:50 +0200)
[ Upstream commit 47a357de2b6b706af3c9471d5042f9ba8907031e ]

Variable "in" in dr_create_rc_qp() is allocated with kvzalloc() and
should be freed with kvfree().

Fixes: 297cccebdc5a ("net/mlx5: DR, Expose an internal API to issue RDMA operations")
Cc: stable@vger.kernel.org
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c

index 7c77378..f012aac 100644 (file)
@@ -181,7 +181,7 @@ static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev,
                                                         in, pas));
 
        err = mlx5_core_create_qp(mdev, &dr_qp->mqp, in, inlen);
-       kfree(in);
+       kvfree(in);
 
        if (err) {
                mlx5_core_warn(mdev, " Can't create QP\n");