usb: wusb: don't overflow the Keep Alive IE buffer
authorDavid Vrabel <david.vrabel@csr.com>
Mon, 22 Mar 2010 14:50:14 +0000 (14:50 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Apr 2010 22:18:22 +0000 (15:18 -0700)
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>
drivers/usb/wusbcore/devconnect.c

index 46e79d3494986a44896884d0a42dde65e18f43f6..7ec24e46b34bef5269b220b71b8382eaa9140c16 100644 (file)
@@ -438,7 +438,7 @@ static void __wusbhc_keep_alive(struct wusbhc *wusbhc)
        old_keep_alives = ie->hdr.bLength - sizeof(ie->hdr);
        keep_alives = 0;
        for (cnt = 0;
-            keep_alives <= WUIE_ELT_MAX && cnt < wusbhc->ports_max;
+            keep_alives < WUIE_ELT_MAX && cnt < wusbhc->ports_max;
             cnt++) {
                unsigned tt = msecs_to_jiffies(wusbhc->trust_timeout);