Commit 0f9826f4 authored by Jason Gunthorpe's avatar Jason Gunthorpe

RDMA/odp: Fix leaking the tgid for implicit ODP

The tgid used to be part of ib_umem_free_notifier(), when it was reworked
it got moved to release, but it should have been unconditional as all umem
alloc paths get the tgid.

As is, creating an implicit ODP will leak the tgid reference.

Link: https://lore.kernel.org/r/20200304181607.GA22412@ziepe.ca
Cc: stable@kernel.org
Fixes: f25a546e ("RDMA/odp: Use mmu_interval_notifier_insert()")
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 2c523b34
...@@ -275,8 +275,8 @@ void ib_umem_odp_release(struct ib_umem_odp *umem_odp) ...@@ -275,8 +275,8 @@ void ib_umem_odp_release(struct ib_umem_odp *umem_odp)
mmu_interval_notifier_remove(&umem_odp->notifier); mmu_interval_notifier_remove(&umem_odp->notifier);
kvfree(umem_odp->dma_list); kvfree(umem_odp->dma_list);
kvfree(umem_odp->page_list); kvfree(umem_odp->page_list);
put_pid(umem_odp->tgid);
} }
put_pid(umem_odp->tgid);
kfree(umem_odp); kfree(umem_odp);
} }
EXPORT_SYMBOL(ib_umem_odp_release); EXPORT_SYMBOL(ib_umem_odp_release);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment