Patch "IB/mlx4: Fix memory leak if QP creation failed" has been added to the 4.4-stable tree
From: <gregkh@linuxfoundation.org>
Date: 2016-08-18 12:44:28
This is a note to let you know that I've just added the patch titled
IB/mlx4: Fix memory leak if QP creation failed
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-mlx4-fix-memory-leak-if-qp-creation-failed.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let [off-list ref] know about it.
From 5b420d9cf7382c6e1512e96e02d18842d272049c Mon Sep 17 00:00:00 2001
From: Dotan Barak <redacted>
Date: Wed, 22 Jun 2016 17:27:31 +0300
Subject: IB/mlx4: Fix memory leak if QP creation failed
From: Dotan Barak <redacted>
commit 5b420d9cf7382c6e1512e96e02d18842d272049c upstream.
When RC, UC, or RAW QPs are created, a qp object is allocated (kzalloc).
If at a later point (in procedure create_qp_common) the qp creation fails,
this qp object must be freed.
Fixes: 1ffeb2eb8be99 ("IB/mlx4: SR-IOV IB context objects and proxy/tunnel SQP support")
Signed-off-by: Dotan Barak <redacted>
Signed-off-by: Jack Morgenstein <redacted>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/mlx4/qp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c@@ -1162,8 +1162,10 @@ struct ib_qp *mlx4_ib_create_qp(struct i { err = create_qp_common(to_mdev(pd->device), pd, init_attr, udata, 0, &qp, gfp); - if (err) + if (err) { + kfree(qp); return ERR_PTR(err); + } qp->ibqp.qp_num = qp->mqp.qpn; qp->xrcdn = xrcdn;
Patches currently in stable-queue which might be from dotanb@dev.mellanox.co.il are queue-4.4/ib-mlx4-fix-memory-leak-if-qp-creation-failed.patch