Commit a23b6484 authored by David Vrabel's avatar David Vrabel Committed by Greg Kroah-Hartman

usb: wusb: don't overflow the Keep Alive IE buffer

The Keep Alive IE only has space for WUIE_ELT_MAX (== 4) device addresses.
Signed-off-by: default avatarDavid Vrabel <david.vrabel@csr.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 18f91196
...@@ -438,7 +438,7 @@ static void __wusbhc_keep_alive(struct wusbhc *wusbhc) ...@@ -438,7 +438,7 @@ static void __wusbhc_keep_alive(struct wusbhc *wusbhc)
old_keep_alives = ie->hdr.bLength - sizeof(ie->hdr); old_keep_alives = ie->hdr.bLength - sizeof(ie->hdr);
keep_alives = 0; keep_alives = 0;
for (cnt = 0; for (cnt = 0;
keep_alives <= WUIE_ELT_MAX && cnt < wusbhc->ports_max; keep_alives < WUIE_ELT_MAX && cnt < wusbhc->ports_max;
cnt++) { cnt++) {
unsigned tt = msecs_to_jiffies(wusbhc->trust_timeout); unsigned tt = msecs_to_jiffies(wusbhc->trust_timeout);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment