aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2009-02-22 23:14:37 -0500
committerRoland Dreier <rolandd@cisco.com>2009-02-22 23:14:37 -0500
commite538052746d570c874650a24eed89fca6e4c93dc (patch)
tree308b1a9829002328cdd91ef913a486b31b6342c2 /drivers/infiniband
parent71c4512201575c7cc008b364e2e2c75cc7085c26 (diff)
IB/ipath: Really run work in ipath_release_user_pages_on_close()
ipath_release_user_pages_on_close() just allocated a structure to schedule work with but just returned (leaking the structure) rather than actually doing schedule_work(). Fix the logic to what was intended. This was spotted by the Coverity checker (CID 2700). Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_user_pages.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_user_pages.c b/drivers/infiniband/hw/ipath/ipath_user_pages.c
index 0190edc8044e..855911e7396d 100644
--- a/drivers/infiniband/hw/ipath/ipath_user_pages.c
+++ b/drivers/infiniband/hw/ipath/ipath_user_pages.c
@@ -209,20 +209,20 @@ void ipath_release_user_pages_on_close(struct page **p, size_t num_pages)
209 209
210 mm = get_task_mm(current); 210 mm = get_task_mm(current);
211 if (!mm) 211 if (!mm)
212 goto bail; 212 return;
213 213
214 work = kmalloc(sizeof(*work), GFP_KERNEL); 214 work = kmalloc(sizeof(*work), GFP_KERNEL);
215 if (!work) 215 if (!work)
216 goto bail_mm; 216 goto bail_mm;
217 217
218 goto bail;
219
220 INIT_WORK(&work->work, user_pages_account); 218 INIT_WORK(&work->work, user_pages_account);
221 work->mm = mm; 219 work->mm = mm;
222 work->num_pages = num_pages; 220 work->num_pages = num_pages;
223 221
222 schedule_work(&work->work);
223 return;
224
224bail_mm: 225bail_mm:
225 mmput(mm); 226 mmput(mm);
226bail:
227 return; 227 return;
228} 228}