Re: [PATCH v11 rdma-next 2/7] RDMA/core: Create mmap database and cookie helper functions

Jason Gunthorpe
2019-09-19T17:48:20Z

On Thu, Sep 05, 2019 at 01:01:12PM +0300, Michal Kalderon wrote:

> @@ -917,6 +921,9 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
>
> priv = list_first_entry(&ufile->umaps,
> struct rdma_umap_priv, list);
> + if (priv->entry)
> + rdma_user_mmap_entry_put(ufile->ucontext,
> + priv->entry);

This is in the wrong place, as the comment says the purpose of this
loop is only to get a single mm the actual zap & deletion is the 2nd
loop below, which is where this should be.

Further, it needs to set priv->entry to null after putting it
otherwise it will be double put when rdma_umap_close() is eventually
called.

Jason