public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usbip_start_threads(): handle kernel_thread failure
@ 2008-12-19 22:37 Roel Kluin
  2009-01-25 23:00 ` patch staging-usbip-usbip_start_threads-handle-kernel_thread-failure.patch added to gregkh-2.6 tree gregkh
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2008-12-19 22:37 UTC (permalink / raw)
  To: Greg KH; +Cc: lkml

kernel_thread may fail, notice this.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 drivers/staging/usbip/usbip_common.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c
index 72e2092..3d099e8 100644
--- a/drivers/staging/usbip/usbip_common.c
+++ b/drivers/staging/usbip/usbip_common.c
@@ -406,8 +406,20 @@ void usbip_start_threads(struct usbip_device *ud)
 	/*
 	 * threads are invoked per one device (per one connection).
 	 */
-	kernel_thread(usbip_thread, (void *)&ud->tcp_rx, 0);
-	kernel_thread(usbip_thread, (void *)&ud->tcp_tx, 0);
+	int retval;
+
+	retval = kernel_thread(usbip_thread, (void *)&ud->tcp_rx, 0);
+	if (retval < 0) {
+		printk(KERN_ERR "Creating tcp_rx thread for ud %p failed.\n",
+				ud); 
+		return;
+	}
+	retval = kernel_thread(usbip_thread, (void *)&ud->tcp_tx, 0);
+	if (retval < 0) {
+		printk(KERN_ERR "Creating tcp_tx thread for ud %p failed.\n",
+				ud); 
+		return;
+	}
 
 	/* confirm threads are starting */
 	wait_for_completion(&ud->tcp_rx.thread_done);


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

* patch staging-usbip-usbip_start_threads-handle-kernel_thread-failure.patch added to gregkh-2.6 tree
  2008-12-19 22:37 [PATCH] usbip_start_threads(): handle kernel_thread failure Roel Kluin
@ 2009-01-25 23:00 ` gregkh
  0 siblings, 0 replies; 2+ messages in thread
From: gregkh @ 2009-01-25 23:00 UTC (permalink / raw)
  To: roel.kluin, gregkh, linux-kernel


This is a note to let you know that I've just added the patch titled

    Subject: Staging: usbip: usbip_start_threads(): handle kernel_thread failure

to my gregkh-2.6 tree.  Its filename is

    staging-usbip-usbip_start_threads-handle-kernel_thread-failure.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From roel.kluin@gmail.com  Sun Jan 25 14:35:50 2009
From: Roel Kluin <roel.kluin@gmail.com>
Date: Fri, 19 Dec 2008 23:37:30 +0100
Subject: Staging: usbip: usbip_start_threads(): handle kernel_thread failure
To: Greg KH <gregkh@suse.de>
Cc: lkml <linux-kernel@vger.kernel.org>
Message-ID: <494C222A.8050507@gmail.com>


kernel_thread may fail, notice this.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/usbip/usbip_common.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

--- a/drivers/staging/usbip/usbip_common.c
+++ b/drivers/staging/usbip/usbip_common.c
@@ -406,8 +406,20 @@ void usbip_start_threads(struct usbip_de
 	/*
 	 * threads are invoked per one device (per one connection).
 	 */
-	kernel_thread(usbip_thread, (void *)&ud->tcp_rx, 0);
-	kernel_thread(usbip_thread, (void *)&ud->tcp_tx, 0);
+	int retval;
+
+	retval = kernel_thread(usbip_thread, (void *)&ud->tcp_rx, 0);
+	if (retval < 0) {
+		printk(KERN_ERR "Creating tcp_rx thread for ud %p failed.\n",
+				ud);
+		return;
+	}
+	retval = kernel_thread(usbip_thread, (void *)&ud->tcp_tx, 0);
+	if (retval < 0) {
+		printk(KERN_ERR "Creating tcp_tx thread for ud %p failed.\n",
+				ud);
+		return;
+	}
 
 	/* confirm threads are starting */
 	wait_for_completion(&ud->tcp_rx.thread_done);


Patches currently in gregkh-2.6 which might be from roel.kluin@gmail.com are

staging/staging-meilhaus-unsigned-won-t-get-negative-after-subtraction.patch
staging/staging-otus-logical-bit-and-confusion.patch
staging/staging-usbip-usbip_start_threads-handle-kernel_thread-failure.patch

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

end of thread, other threads:[~2009-01-25 23:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-19 22:37 [PATCH] usbip_start_threads(): handle kernel_thread failure Roel Kluin
2009-01-25 23:00 ` patch staging-usbip-usbip_start_threads-handle-kernel_thread-failure.patch added to gregkh-2.6 tree gregkh

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