From 8d3cf62e68b29b3aa2a0b90b438389799f660b83 Mon Sep 17 00:00:00 2001 From: n_hibma Date: Sun, 2 Sep 2001 09:26:14 +0000 Subject: Only clear endpoint stall if status was USBD_STALLED. This avoids panicing the system by unplugging a hub. The interrupt transfer would sometimes arrive after the driver had been removed. --- sys/dev/usb/ukbd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/dev/usb/ukbd.c') diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index ad2c8f1..6d3aa4e 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -700,7 +700,8 @@ ukbd_interrupt(keyboard_t *kbd, void *arg) if (status != USBD_NORMAL_COMPLETION) { DPRINTF(("ukbd_intr: status=%d\n", status)); - usbd_clear_endpoint_stall_async(state->ks_intrpipe); + if (status == USBD_STALLED) + usbd_clear_endpoint_stall_async(state->ks_intrpipe); return 0; } -- cgit v1.1