diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-05-12 10:13:41 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-05-12 10:13:41 +0200 |
commit | 8becdc18c3e1f855cae5af266f6a1f5ce5af24fb (patch) | |
tree | c42e2d4274b1aa17a7822385535ac8524e4a6822 /drivers/usb/class/cdc-acm.c | |
parent | 3c1b5c9bd991d1c023f736b0187582aae8a5b30a (diff) | |
parent | 030bbdbf4c833bc69f502eae58498bc5572db736 (diff) |
Merge tag 'v4.1-rc3' into devel
Linux 4.1-rc3
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 3e15add665e2..5c8f58114677 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1142,11 +1142,16 @@ static int acm_probe(struct usb_interface *intf, } while (buflen > 0) { + elength = buffer[0]; + if (!elength) { + dev_err(&intf->dev, "skipping garbage byte\n"); + elength = 1; + goto next_desc; + } if (buffer[1] != USB_DT_CS_INTERFACE) { dev_err(&intf->dev, "skipping garbage\n"); goto next_desc; } - elength = buffer[0]; switch (buffer[2]) { case USB_CDC_UNION_TYPE: /* we've found it */ |