提交 6682bb39 编写于 作者: S Sarah Sharp 提交者: Greg Kroah-Hartman

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: NSarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 624defa1
...@@ -105,7 +105,7 @@ static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, ...@@ -105,7 +105,7 @@ static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
ep->ss_ep_comp->extralen = i; ep->ss_ep_comp->extralen = i;
buffer += i; buffer += i;
size -= i; size -= i;
retval = buffer - buffer_start + i; retval = buffer - buffer_start;
if (num_skipped > 0) if (num_skipped > 0)
dev_dbg(ddev, "skipped %d descriptor%s after %s\n", dev_dbg(ddev, "skipped %d descriptor%s after %s\n",
num_skipped, plural(num_skipped), num_skipped, plural(num_skipped),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册