summaryrefslogtreecommitdiffstats
path: root/drivers/usb/usbip/vudc_tx.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-01-18 00:32:15 +0100
committerDave Airlie <airlied@redhat.com>2018-01-18 00:32:15 +0100
commit4a6cc7a44e98a0460bd094b68c75f0705fdc450a (patch)
treeb8c86a1e0342b1166ab52c4d79e404eede57abec /drivers/usb/usbip/vudc_tx.c
parentMerge branch 'drm-next-4.16' of git://people.freedesktop.org/~agd5f/linux int... (diff)
parentLinux 4.15-rc8 (diff)
downloadlinux-4a6cc7a44e98a0460bd094b68c75f0705fdc450a.tar.xz
linux-4a6cc7a44e98a0460bd094b68c75f0705fdc450a.zip
BackMerge tag 'v4.15-rc8' into drm-next
Linux 4.15-rc8 Daniel requested this for so the intel CI won't fall over on drm-next so often.
Diffstat (limited to 'drivers/usb/usbip/vudc_tx.c')
-rw-r--r--drivers/usb/usbip/vudc_tx.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/usb/usbip/vudc_tx.c b/drivers/usb/usbip/vudc_tx.c
index 1440ae0919ec..3ccb17c3e840 100644
--- a/drivers/usb/usbip/vudc_tx.c
+++ b/drivers/usb/usbip/vudc_tx.c
@@ -85,6 +85,13 @@ static int v_send_ret_submit(struct vudc *udc, struct urbp *urb_p)
memset(&pdu_header, 0, sizeof(pdu_header));
memset(&msg, 0, sizeof(msg));
+ if (urb->actual_length > 0 && !urb->transfer_buffer) {
+ dev_err(&udc->gadget.dev,
+ "urb: actual_length %d transfer_buffer null\n",
+ urb->actual_length);
+ return -1;
+ }
+
if (urb_p->type == USB_ENDPOINT_XFER_ISOC)
iovnum = 2 + urb->number_of_packets;
else
@@ -100,8 +107,8 @@ static int v_send_ret_submit(struct vudc *udc, struct urbp *urb_p)
/* 1. setup usbip_header */
setup_ret_submit_pdu(&pdu_header, urb_p);
- usbip_dbg_stub_tx("setup txdata seqnum: %d urb: %p\n",
- pdu_header.base.seqnum, urb);
+ usbip_dbg_stub_tx("setup txdata seqnum: %d\n",
+ pdu_header.base.seqnum);
usbip_header_correct_endian(&pdu_header, 1);
iov[iovnum].iov_base = &pdu_header;