aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/usbip/vhci_rx.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c
index bdbedd256903..ac15cea75396 100644
--- a/drivers/staging/usbip/vhci_rx.c
+++ b/drivers/staging/usbip/vhci_rx.c
@@ -205,11 +205,23 @@ static void vhci_rx_pdu(struct usbip_device *ud)
205 205
206 memset(&pdu, 0, sizeof(pdu)); 206 memset(&pdu, 0, sizeof(pdu));
207 207
208
209 /* 1. receive a pdu header */ 208 /* 1. receive a pdu header */
210 ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); 209 ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0);
210 if (ret < 0) {
211 if (ret == -ECONNRESET)
212 usbip_uinfo("connection reset by peer\n");
213 else if (ret != -ERESTARTSYS)
214 usbip_uinfo("xmit failed %d\n", ret);
215 usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
216 return;
217 }
218 if (ret == 0) {
219 usbip_uinfo("connection closed");
220 usbip_event_add(ud, VDEV_EVENT_DOWN);
221 return;
222 }
211 if (ret != sizeof(pdu)) { 223 if (ret != sizeof(pdu)) {
212 usbip_uerr("receiving pdu failed! size is %d, should be %d\n", 224 usbip_uerr("received pdu size is %d, should be %d\n",
213 ret, (unsigned int)sizeof(pdu)); 225 ret, (unsigned int)sizeof(pdu));
214 usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); 226 usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
215 return; 227 return;