提交 b081808a 编写于 作者: L Leon Romanovsky 提交者: Jason Gunthorpe

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: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Reviewed-by: NMajd Dibbiny <majd@mellanox.com>
Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: NYuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 f23a5350
...@@ -5067,13 +5067,10 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd) ...@@ -5067,13 +5067,10 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd)
int err; int err;
err = mlx5_core_xrcd_dealloc(dev->mdev, xrcdn); err = mlx5_core_xrcd_dealloc(dev->mdev, xrcdn);
if (err) { if (err)
mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn); mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn);
return err;
}
kfree(xrcd); kfree(xrcd);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册