aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.co.il>2007-05-14 04:35:43 -0400
committerRoland Dreier <rolandd@cisco.com>2007-05-19 11:51:53 -0400
commit7b82cd8ee7374f803a3daf9a6cbc6eb4bbb10a63 (patch)
tree2ff12883dc0f1116a29c83d4396e8c965fcd13fe /drivers
parent55b637c6a003a8c4850b41a2c2fd6942d8a7f530 (diff)
IB/core: Free umem when mm is already gone
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/umem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index f32ca5fbb26b..6009234e4f9e 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -209,8 +209,10 @@ void ib_umem_release(struct ib_umem *umem)
209 __ib_umem_release(umem->context->device, umem, 1); 209 __ib_umem_release(umem->context->device, umem, 1);
210 210
211 mm = get_task_mm(current); 211 mm = get_task_mm(current);
212 if (!mm) 212 if (!mm) {
213 kfree(umem);
213 return; 214 return;
215 }
214 216
215 diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT; 217 diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT;
216 218