diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2018-01-28 10:25:30 +0100 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-01-28 22:07:16 +0100 |
commit | b081808a66345ba725b77ecd8d759bee874cd937 (patch) | |
tree | b938f6a4fe6dafdaf7c8a7ac6f5df67dbbd06a7a | |
parent | IB/umad: Fix use of unprotected device pointer (diff) | |
download | linux-b081808a66345ba725b77ecd8d759bee874cd937.tar.xz linux-b081808a66345ba725b77ecd8d759bee874cd937.zip |
RDMA/mlx5: Avoid memory leak in case of XRCD dealloc failure
Failure in XRCD FW deallocation command leaves memory leaked and
returns error to the user which he can't do anything about it.
This patch changes behavior to always free memory and always return
success to the user.
Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Reviewed-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index ae36db3d0deb..d5cc95ffd4ac 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -5067,13 +5067,10 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd) int err; err = mlx5_core_xrcd_dealloc(dev->mdev, xrcdn); - if (err) { + if (err) mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn); - return err; - } kfree(xrcd); - return 0; } |