summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/message.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-11-03 13:50:41 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-11-03 13:50:41 +0200
commit7d9a6ef558f6ff375aab9e29f08124cb0daa9bc5 (patch)
tree3916e6cf9678a41081ae822ef67ec5cae1c1fffa /drivers/usb/core/message.c
parent3fcf2b2a2529e268c537d8ad9dac5987ebc8a2f7 (diff)
parent0224d45c9d46401b6d7018a96cfe049c5da7d91c (diff)
downloadtalos-op-linux-7d9a6ef558f6ff375aab9e29f08124cb0daa9bc5.tar.gz
talos-op-linux-7d9a6ef558f6ff375aab9e29f08124cb0daa9bc5.zip
Merge branch 'i2c/cht-wc-fusb302-immutable' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c/cht-wc-fusb302-immutable immutable branch from Wolfram Sang: as discussed before, here is the immutable branch for the i2c-cht-wc driver, so you can safely apply Hans' patch [1] "platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties" on top of this. [1] http://patchwork.ozlabs.org/patch/824314/
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r--drivers/usb/core/message.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 4c38ea41ae96..371a07d874a3 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -2069,6 +2069,10 @@ int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr,
elength = 1;
goto next_desc;
}
+ if ((buflen < elength) || (elength < 3)) {
+ dev_err(&intf->dev, "invalid descriptor buffer length\n");
+ break;
+ }
if (buffer[1] != USB_DT_CS_INTERFACE) {
dev_err(&intf->dev, "skipping garbage\n");
goto next_desc;
OpenPOWER on IntegriCloud