Skip to content

Commit d810c54

Browse files
Leon Romanovskygregkh
authored andcommitted
RDMA/mlx5: Avoid memory leak in case of XRCD dealloc failure
[ Upstream commit b081808 ] 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: e126ba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Reviewed-by: Majd Dibbiny <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Yuval Shaia <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0bddd43 commit d810c54

File tree

1 file changed

+1
-4
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+1
-4
lines changed

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4636,13 +4636,10 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd)
46364636
int err;
46374637

46384638
err = mlx5_core_xrcd_dealloc(dev->mdev, xrcdn);
4639-
if (err) {
4639+
if (err)
46404640
mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn);
4641-
return err;
4642-
}
46434641

46444642
kfree(xrcd);
4645-
46464643
return 0;
46474644
}
46484645

0 commit comments

Comments
 (0)