Message ID | 20210304152455.3685-9-penguin-kernel@I-love.SAKURA.ne.jp (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | usb: usbip: serialize attach/detach operations | expand |
diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c index 9f677c5a74e8..f80098c3dd10 100644 --- a/drivers/usb/usbip/usbip_common.c +++ b/drivers/usb/usbip/usbip_common.c @@ -762,6 +762,11 @@ int usbip_prepare_threads(struct usbip_thread_info *uti, socket = sockfd_lookup(sockfd, &err); if (!socket) return -EINVAL; + /* Verify that this is a stream socket. */ + if (socket->type != SOCK_STREAM) { + err = -EINVAL; + goto out_socket; + } /* Create threads for this socket. */ rx = kthread_create(rx_fn, ud, rx_name); if (IS_ERR(rx)) {