Module Name:    src
Committed By:   christos
Date:           Thu Dec  2 17:38:05 UTC 2010

Modified Files:
        src/sys/dev/usb: if_otus.c

Log Message:
just ignore things that refer to the interface while detaching.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_otus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_otus.c
diff -u src/sys/dev/usb/if_otus.c:1.8 src/sys/dev/usb/if_otus.c:1.9
--- src/sys/dev/usb/if_otus.c:1.8	Thu Dec  2 11:56:21 2010
+++ src/sys/dev/usb/if_otus.c	Thu Dec  2 12:38:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_otus.c,v 1.8 2010/12/02 16:56:21 christos Exp $	*/
+/*	$NetBSD: if_otus.c,v 1.9 2010/12/02 17:38:05 christos Exp $	*/
 /*	$OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $	*/
 
 /*-
@@ -645,22 +645,22 @@
 
 	DPRINTF("otus_detach\n");
 
-	if (ifp == NULL)	/* Failed to attach properly */
-		return 0;
-
-	otus_stop(ifp);
+	if (ifp != NULL)	/* Failed to attach properly */
+		otus_stop(ifp);
 
 	s = splnet();
 
 	/* Wait for all queued asynchronous commands to complete. */
-	while (sc->sc_cmdq.queued > 0)
-		tsleep(&sc->sc_cmdq, 0, "sc_cmdq", 0);
+	if (ifp != NULL) {
+		while (sc->sc_cmdq.queued > 0)
+			tsleep(&sc->sc_cmdq, 0, "sc_cmdq", 0);
+	}
 
 	usb_rem_task(sc->sc_udev, &sc->sc_task);
 	callout_destroy(&sc->sc_scan_to);
 	callout_destroy(&sc->sc_calib_to);
 
-	if (ifp->if_flags != 0) {	/* if_attach() has been called. */
+	if (ifp && ifp->if_flags != 0) { /* if_attach() has been called. */
 		ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
 		bpf_detach(ifp);
 		ieee80211_ifdetach(&sc->sc_ic);

Reply via email to