# Re: f0ae4afe3d35 ("RDMA/mlx5: Fix releasing unallocated memory in dereg MR flow")

- From: Maor Gottlieb \<hidden\>
- Date: 2021-12-19 09:51:11 
- List: linux-rdma
- Page: https://ratatoskr.run/linux-rdma/2021/12/15465774
- Thread: https://ratatoskr.run/linux-rdma/2021/12/15465770/t.md

```text

On 12/18/2021 11:25 PM, Chuck Lever III wrote:
> NFS/RDMA with an NFS client using mlx5-based hardware triggers a
> system deadlock (no error messages) on the client. I bisected to
> f0ae4afe3d35 ("RDMA/mlx5: Fix releasing unallocated memory in
> dereg MR flow").
>
> --
> Chuck Lever

Hi Chuck,

I found some bug in the cited commit. Can you please test if the below patch fixes this deadlock ?

diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 157d862fb864..3cb4e34fe199 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -1978,7 +1978,7 @@ int mlx5_ib_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
                        return rc;
        }

-   if (mr->umem) {
+ if (udata && mr->umem) {
                bool is_odp = is_odp_mr(mr);

                if (!is_odp)

>
>
>
```
