Skip to content

Commit

Permalink
IB/core: Free umem when mm is already gone
Browse files Browse the repository at this point in the history
Free umem when task's mm is already destroyed by the time
ib_umem_release gets called.

Found by Dotan Barak at Mellanox.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Eli Cohen authored and Roland Dreier committed May 19, 2007
1 parent 55b637c commit 7b82cd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/infiniband/core/umem.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ void ib_umem_release(struct ib_umem *umem)
__ib_umem_release(umem->context->device, umem, 1);

mm = get_task_mm(current);
if (!mm)
if (!mm) {
kfree(umem);
return;
}

diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT;

Expand Down

0 comments on commit 7b82cd8

Please sign in to comment.