Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb just ignore things that refer to the interface w...



details:   https://anonhg.NetBSD.org/src/rev/0fc6ef50fe41
branches:  trunk
changeset: 759228:0fc6ef50fe41
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Dec 02 17:38:05 2010 +0000

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

diffstat:

 sys/dev/usb/if_otus.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (39 lines):

diff -r 4ccf4fbe5758 -r 0fc6ef50fe41 sys/dev/usb/if_otus.c
--- a/sys/dev/usb/if_otus.c     Thu Dec 02 16:56:21 2010 +0000
+++ b/sys/dev/usb/if_otus.c     Thu Dec 02 17:38:05 2010 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index