提交 05d6d677 编写于 作者: R Roel Kluin 提交者: Greg Kroah-Hartman

Staging: usbip: usbip_start_threads(): handle kernel_thread failure

kernel_thread may fail, notice this.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 e48d94da
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册