diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2008-12-19 17:37:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@kvm.kroah.org> | 2009-01-28 18:49:05 -0500 |
commit | 05d6d677ab4b975697c6a987f1dffdc55d61a160 (patch) | |
tree | 73fa9a7d796f164eb6ed6b8c7737f9c0f9ac5cef /drivers | |
parent | e48d94dac7eef16b4a4f246bf7b8df0f00cc0aec (diff) |
Staging: usbip: usbip_start_threads(): handle kernel_thread failure
kernel_thread may fail, notice this.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 72e209276ea7..22f93dd0ba03 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) | |||
406 | /* | 406 | /* |
407 | * threads are invoked per one device (per one connection). | 407 | * threads are invoked per one device (per one connection). |
408 | */ | 408 | */ |
409 | kernel_thread(usbip_thread, (void *)&ud->tcp_rx, 0); | 409 | int retval; |
410 | kernel_thread(usbip_thread, (void *)&ud->tcp_tx, 0); | 410 | |
411 | retval = kernel_thread(usbip_thread, (void *)&ud->tcp_rx, 0); | ||
412 | if (retval < 0) { | ||
413 | printk(KERN_ERR "Creating tcp_rx thread for ud %p failed.\n", | ||
414 | ud); | ||
415 | return; | ||
416 | } | ||
417 | retval = kernel_thread(usbip_thread, (void *)&ud->tcp_tx, 0); | ||
418 | if (retval < 0) { | ||
419 | printk(KERN_ERR "Creating tcp_tx thread for ud %p failed.\n", | ||
420 | ud); | ||
421 | return; | ||
422 | } | ||
411 | 423 | ||
412 | /* confirm threads are starting */ | 424 | /* confirm threads are starting */ |
413 | wait_for_completion(&ud->tcp_rx.thread_done); | 425 | wait_for_completion(&ud->tcp_rx.thread_done); |