aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/wusbcore
diff options
context:
space:
mode:
authorThomas Pugliese <thomas.pugliese@gmail.com>2014-02-28 16:15:19 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-28 19:14:48 -0500
commit4659a2452baa7d89324fda097158d7f8fe71e0cb (patch)
treee7a7baee33501d5e3713a725c28e786d193b2e33 /drivers/usb/wusbcore
parente500d526f968f184462912334b74b80dc905fca0 (diff)
usb: wusbcore: adjust iterator correctly when searching for ep comp descriptor
If the endpoint companion descriptor is not the first descriptor in the extra descriptor buffer of a usb_host_endpoint, the loop in rpipe_epc_find will get its buffer pointer and remaining size values out of sync. The buffer ptr 'itr' is advanced by the descriptor's bLength field but the remaining size value 'itr_size' is decremented by the bDescriptorType field which is incorrect. This patch fixes the loop to decrement itr_size by bLength as it should. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/wusbcore')
-rw-r--r--drivers/usb/wusbcore/wa-rpipe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/wusbcore/wa-rpipe.c b/drivers/usb/wusbcore/wa-rpipe.c
index 6ca80a4efc1b..6d6da127f6de 100644
--- a/drivers/usb/wusbcore/wa-rpipe.c
+++ b/drivers/usb/wusbcore/wa-rpipe.c
@@ -298,7 +298,7 @@ static struct usb_wireless_ep_comp_descriptor *rpipe_epc_find(
298 break; 298 break;
299 } 299 }
300 itr += hdr->bLength; 300 itr += hdr->bLength;
301 itr_size -= hdr->bDescriptorType; 301 itr_size -= hdr->bLength;
302 } 302 }
303out: 303out:
304 return epcd; 304 return epcd;