Skip to content

Commit b081808

Browse files
Leon Romanovskyjgunthorpe
authored andcommitted
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: 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]>
1 parent f23a535 commit b081808

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
@@ -5067,13 +5067,10 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd)
50675067
int err;
50685068

50695069
err = mlx5_core_xrcd_dealloc(dev->mdev, xrcdn);
5070-
if (err) {
5070+
if (err)
50715071
mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn);
5072-
return err;
5073-
}
50745072

50755073
kfree(xrcd);
5076-
50775074
return 0;
50785075
}
50795076

0 commit comments

Comments
 (0)