IB/ipath: Really run work in ipath_release_user_pages_on_close()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 4:59 pm

Gitweb:     http://git.kernel.org/linus/e538052746d570c874650a24eed89fca6e4c93dc
Commit:     e538052746d570c874650a24eed89fca6e4c93dc
Parent:     71c4512201575c7cc008b364e2e2c75cc7085c26
Author:     Roland Dreier <rolandd@cisco.com>
AuthorDate: Sun Feb 22 20:14:37 2009 -0800
Committer:  Roland Dreier <rolandd@cisco.com>
CommitDate: Sun Feb 22 20:14:37 2009 -0800

    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>
---
 drivers/infiniband/hw/ipath/ipath_user_pages.c |    8 ++++----
 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 0190edc..855911e 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)
 
 	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;
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
IB/ipath: Really run work in ipath_release_user_pages_on_c ..., Linux Kernel Mailing ..., (Thu Mar 26, 4:59 pm)