]>
Commit | Line | Data |
---|---|---|
66e34d0a GKH |
1 | From bede98e781747623ae170667694a71ef19c6ba7f Mon Sep 17 00:00:00 2001 |
2 | From: Majd Dibbiny <majd@mellanox.com> | |
3 | Date: Thu, 29 Jan 2015 10:41:41 +0200 | |
4 | Subject: IB/mlx4: Fix memory leak in __mlx4_ib_modify_qp | |
5 | ||
6 | From: Majd Dibbiny <majd@mellanox.com> | |
7 | ||
8 | commit bede98e781747623ae170667694a71ef19c6ba7f upstream. | |
9 | ||
10 | In case handle_eth_ud_smac_index fails, we need to free the allocated resources. | |
11 | ||
12 | Fixes: 2f5bb473681b ("mlx4: Add ref counting to port MAC table for RoCE") | |
13 | Signed-off-by: Majd Dibbiny <majd@mellanox.com> | |
14 | Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> | |
15 | Signed-off-by: Roland Dreier <roland@purestorage.com> | |
16 | Signed-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 | } |