Commit 6682bb39e111b34290e25c4d275c5bcf8bbccbe1

Authored by Sarah Sharp
Committed by Greg Kroah-Hartman
1 parent 624defa12f

USB: Fix SS endpoint companion descriptor parsing.

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>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/usb/core/config.c
... ... @@ -105,7 +105,7 @@
105 105 ep->ss_ep_comp->extralen = i;
106 106 buffer += i;
107 107 size -= i;
108   - retval = buffer - buffer_start + i;
  108 + retval = buffer - buffer_start;
109 109 if (num_skipped > 0)
110 110 dev_dbg(ddev, "skipped %d descriptor%s after %s\n",
111 111 num_skipped, plural(num_skipped),