summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_wi_usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/if_wi_usb.c')
-rw-r--r--sys/dev/usb/if_wi_usb.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c
index ba2834948e2..c601a9c6d91 100644
--- a/sys/dev/usb/if_wi_usb.c
+++ b/sys/dev/usb/if_wi_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_usb.c,v 1.47 2010/07/02 03:13:42 tedu Exp $ */
+/* $OpenBSD: if_wi_usb.c,v 1.48 2010/09/24 08:33:59 yuo Exp $ */
/*
* Copyright (c) 2003 Dale Rahn. All rights reserved.
@@ -400,7 +400,10 @@ wi_usb_detach(struct device *self, int flags)
int s;
int err;
- sc->wi_usb_dying = 1;
+ /* Detached before attach finished, so just bail out. */
+ if (!sc->wi_usb_attached)
+ return (0);
+
if (sc->wi_thread_info != NULL) {
sc->wi_thread_info->dying = 1;
@@ -409,10 +412,6 @@ wi_usb_detach(struct device *self, int flags)
wakeup(sc->wi_thread_info);
}
- if (!sc->wi_usb_attached) {
- /* Detached before attach finished, so just bail out. */
- return (0);
- }
/* tasks? */
s = splusb();