summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb.c
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>2002-02-14 08:22:37 +0000
committerBrian Feldman <green@FreeBSD.org>2002-02-14 08:22:37 +0000
commitd515a5410bff6e6057fdd5ebdefa227f41c68c4a (patch)
tree41aa5412e3f74b68b7578daff5049818049768a3 /sys/dev/usb/usb.c
parentc0af27c95f5811ca06d87855e26211e9e9f004e3 (diff)
Notes
Diffstat (limited to 'sys/dev/usb/usb.c')
-rw-r--r--sys/dev/usb/usb.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 778c429017d2..f7fe5b726796 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -658,7 +658,7 @@ usbd_add_drv_event(int type, usbd_device_handle udev, device_ptr_t dev)
void
usb_add_event(int type, struct usb_event *uep)
{
- struct usb_event_q *ueq, *ueq_next;
+ struct usb_event_q *ueq;
struct usb_event ue;
struct timeval thetime;
int s;
@@ -671,14 +671,16 @@ usb_add_event(int type, struct usb_event *uep)
s = splusb();
if (USB_EVENT_IS_DETACH(type)) {
- for (ueq = TAILQ_FIRST(&usb_events); ueq; ueq = ueq_next) {
- ueq_next = TAILQ_NEXT(ueq, next);
- if (ueq->ue.u.ue_driver.ue_cookie.cookie ==
+ struct usb_event_q *ueqi, *ueqi_next;
+
+ for (ueqi = TAILQ_FIRST(&usb_events); ueqi; ueqi = ueqi_next) {
+ ueqi_next = TAILQ_NEXT(ueqi, next);
+ if (ueqi->ue.u.ue_driver.ue_cookie.cookie ==
uep->u.ue_device.cookie.cookie) {
- TAILQ_REMOVE(&usb_events, ueq, next);
- free(ueq, M_USBDEV);
+ TAILQ_REMOVE(&usb_events, ueqi, next);
+ free(ueqi, M_USBDEV);
usb_nevents--;
- ueq_next = TAILQ_FIRST(&usb_events);
+ ueqi_next = TAILQ_FIRST(&usb_events);
}
}
}