public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dlm: sanitize work_start() in lowcomms.c
@ 2010-12-13 15:28 Namhyung Kim
  2010-12-13 19:46 ` David Teigland
  0 siblings, 1 reply; 2+ messages in thread
From: Namhyung Kim @ 2010-12-13 15:28 UTC (permalink / raw)
  To: Christine Caulfield, David Teigland
  Cc: cluster-devel, linux-kernel, Tejun Heo

The create_workqueue() returns NULL if failed rather than ERR_PTR().
Fix error checking and remove unnecessary variable 'error'.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
---
 fs/dlm/lowcomms.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 37a34c2c622a..ea04e87b8666 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1430,20 +1430,18 @@ static void work_stop(void)
 
 static int work_start(void)
 {
-	int error;
 	recv_workqueue = create_workqueue("dlm_recv");
-	error = IS_ERR(recv_workqueue);
-	if (error) {
-		log_print("can't start dlm_recv %d", error);
-		return error;
+	if (!recv_workqueue) {
+		log_print("can't start dlm_recv");
+		return -ENOMEM;
 	}
 
 	send_workqueue = create_singlethread_workqueue("dlm_send");
-	error = IS_ERR(send_workqueue);
-	if (error) {
-		log_print("can't start dlm_send %d", error);
+	if (!send_workqueue) {
+		log_print("can't start dlm_send");
 		destroy_workqueue(recv_workqueue);
-		return error;
+		recv_workqueue = NULL;
+		return -ENOMEM;
 	}
 
 	return 0;
-- 
1.7.3.3.400.g93cef


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dlm: sanitize work_start() in lowcomms.c
  2010-12-13 15:28 [PATCH] dlm: sanitize work_start() in lowcomms.c Namhyung Kim
@ 2010-12-13 19:46 ` David Teigland
  0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2010-12-13 19:46 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: Christine Caulfield, cluster-devel, linux-kernel, Tejun Heo

On Tue, Dec 14, 2010 at 12:28:25AM +0900, Namhyung Kim wrote:
> The create_workqueue() returns NULL if failed rather than ERR_PTR().
> Fix error checking and remove unnecessary variable 'error'.

I adapted this to the alloc_workqueue patch in next and pushed to next.
Dave


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-13 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-13 15:28 [PATCH] dlm: sanitize work_start() in lowcomms.c Namhyung Kim
2010-12-13 19:46 ` David Teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox