Skip to contentSkip to conversation

usbip_start_threads(): handle kernel_thread failure

PATCH Applied Roel Kluin 2 participants 2 messages Dec 19, 2008 – Jan 25, 2009 Staging

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 usbip_start_threads(): handle kernel_thread failure

kernel_thread may fail, notice this.

---
 drivers/staging/usbip/usbip_common.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
drivers/staging/usbip/usbip_common.c +14 -2
index 72e2092..3d099e8 100644
@@ -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);
#1 lore raw

patch staging-usbip-usbip_start_threads-handle-kernel_thread-failure.patch added to gregkh-2.6 tree

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/

Quoted 1 line

From [email protected] Sun Jan 25 14:35:50 2009

From: Roel Kluin <[email protected]>
Date: Fri, 19 Dec 2008 23:37:30 +0100
Subject: Staging: usbip: usbip_start_threads(): handle kernel_thread failure
To: Greg KH <[email protected]>
Cc: lkml <[email protected]>
Message-ID: <[email protected]>

kernel_thread may fail, notice this.

---
 drivers/staging/usbip/usbip_common.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/staging/usbip/usbip_common.c +14 -2
@@ -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 [email protected] 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