Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

David Vrabel and committed by
Greg Kroah-Hartman
a23b6484 18f91196

+1 -1
+1 -1
drivers/usb/wusbcore/devconnect.c
··· 438 438 old_keep_alives = ie->hdr.bLength - sizeof(ie->hdr); 439 439 keep_alives = 0; 440 440 for (cnt = 0; 441 - keep_alives <= WUIE_ELT_MAX && cnt < wusbhc->ports_max; 441 + keep_alives < WUIE_ELT_MAX && cnt < wusbhc->ports_max; 442 442 cnt++) { 443 443 unsigned tt = msecs_to_jiffies(wusbhc->trust_timeout); 444 444