Skip to content

Commit cc1b833

Browse files
Leon RomanovskyZhengShunQian
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 8aae636 commit cc1b833

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
@@ -3161,12 +3161,9 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd)
31613161
int err;
31623162

31633163
err = mlx5_core_xrcd_dealloc(dev->mdev, xrcdn);
3164-
if (err) {
3164+
if (err)
31653165
mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn);
3166-
return err;
3167-
}
31683166

31693167
kfree(xrcd);
3170-
31713168
return 0;
31723169
}

0 commit comments

Comments
 (0)