summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2009-09-08 13:20:16 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-10-05 09:32:54 -0700
commit59664c0bdadb460086399375a3203fd08feb6abf (patch)
tree0edc17caa4ed2fc8aa94f8a374ee70c19367b6bb
parent1e7198c04256707887c996bc768e51225bca877e (diff)
downloadlinux-stable-59664c0bdadb460086399375a3203fd08feb6abf.tar.gz
linux-stable-59664c0bdadb460086399375a3203fd08feb6abf.tar.bz2
linux-stable-59664c0bdadb460086399375a3203fd08feb6abf.zip
USB: Fix SS endpoint companion descriptor parsing.
commit 6682bb39e111b34290e25c4d275c5bcf8bbccbe1 upstream. When there's a descriptor after the SuperSpeed endpoint companion descriptor, the previous code would have skipped over twice the length it was supposed to. This code fixes crashes seen with UASP devices (which have a UASP descriptor after the SS endpoint companion descriptor). Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index a16c538d0132..0d3af6a6ee49 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -105,7 +105,7 @@ static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
ep->ss_ep_comp->extralen = i;
buffer += i;
size -= i;
- retval = buffer - buffer_start + i;
+ retval = buffer - buffer_start;
if (num_skipped > 0)
dev_dbg(ddev, "skipped %d descriptor%s after %s\n",
num_skipped, plural(num_skipped),