Skip to content

Commit

Permalink
IB/ipath: Really run work in ipath_release_user_pages_on_close()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roland Dreier committed Feb 23, 2009
1 parent 71c4512 commit e538052
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/infiniband/hw/ipath/ipath_user_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,20 @@ void ipath_release_user_pages_on_close(struct page **p, size_t num_pages)

mm = get_task_mm(current);
if (!mm)
goto bail;
return;

work = kmalloc(sizeof(*work), GFP_KERNEL);
if (!work)
goto bail_mm;

goto bail;

INIT_WORK(&work->work, user_pages_account);
work->mm = mm;
work->num_pages = num_pages;

schedule_work(&work->work);
return;

bail_mm:
mmput(mm);
bail:
return;
}

0 comments on commit e538052

Please sign in to comment.