]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb_kdb: only process events successfully received
authorMichal Suchanek <msuchanek@suse.de>
Sun, 18 Aug 2019 08:55:24 +0000 (10:55 +0200)
committermarex <marex@chi.lan>
Wed, 11 Sep 2019 08:11:29 +0000 (10:11 +0200)
Causes unbound key repeat on error otherwise.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
common/usb_kbd.c

index 387373746147dff2e22b99860b37c6fcc405d2b8..e0c1e6d2b7965908b4a2c338a6951676519f362a 100644 (file)
@@ -340,10 +340,9 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev)
        struct usb_kbd_pdata *data = dev->privptr;
 
        /* Submit a interrupt transfer request */
-       usb_submit_int_msg(dev, data->intpipe, &data->new[0], data->intpktsize,
-                          data->intinterval);
-
-       usb_kbd_irq_worker(dev);
+       if (usb_submit_int_msg(dev, data->intpipe, &data->new[0],
+                              data->intpktsize, data->intinterval) >= 0)
+               usb_kbd_irq_worker(dev);
 #elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) || \
       defined(CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE)
 #if defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP)