]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.19.2/ib-mlx4-fix-memory-leak-in-__mlx4_ib_modify_qp.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.19.2 / ib-mlx4-fix-memory-leak-in-__mlx4_ib_modify_qp.patch
CommitLineData
66e34d0a
GKH
1From bede98e781747623ae170667694a71ef19c6ba7f Mon Sep 17 00:00:00 2001
2From: Majd Dibbiny <majd@mellanox.com>
3Date: Thu, 29 Jan 2015 10:41:41 +0200
4Subject: IB/mlx4: Fix memory leak in __mlx4_ib_modify_qp
5
6From: Majd Dibbiny <majd@mellanox.com>
7
8commit bede98e781747623ae170667694a71ef19c6ba7f upstream.
9
10In case handle_eth_ud_smac_index fails, we need to free the allocated resources.
11
12Fixes: 2f5bb473681b ("mlx4: Add ref counting to port MAC table for RoCE")
13Signed-off-by: Majd Dibbiny <majd@mellanox.com>
14Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
15Signed-off-by: Roland Dreier <roland@purestorage.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18---
19 drivers/infiniband/hw/mlx4/qp.c | 6 ++++--
20 1 file changed, 4 insertions(+), 2 deletions(-)
21
22--- a/drivers/infiniband/hw/mlx4/qp.c
23+++ b/drivers/infiniband/hw/mlx4/qp.c
24@@ -1674,8 +1674,10 @@ static int __mlx4_ib_modify_qp(struct ib
25 qp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI ||
26 qp->mlx4_ib_qp_type == MLX4_IB_QPT_TUN_GSI) {
27 err = handle_eth_ud_smac_index(dev, qp, (u8 *)attr->smac, context);
28- if (err)
29- return -EINVAL;
30+ if (err) {
31+ err = -EINVAL;
32+ goto out;
33+ }
34 if (qp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI)
35 dev->qp1_proxy[qp->port - 1] = qp;
36 }