From: Sarah Sharp Date: Tue, 8 Sep 2009 20:20:16 +0000 (-0700) Subject: USB: Fix SS endpoint companion descriptor parsing. X-Git-Tag: v2.6.31.2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59664c0bdadb460086399375a3203fd08feb6abf;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index a16c538d01329..0d3af6a6ee499 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),