Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/usb urtwn(4): reorder detach to avoid a crash



details:   https://anonhg.NetBSD.org/src-all/rev/bcd021ee34bd
branches:  trunk
changeset: 371591:bcd021ee34bd
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sun Oct 24 13:22:24 2021 +0200

description:
urtwn(4): reorder detach to avoid a crash

There is no point setting the "dying" flag after detaching the usbwifi
device.

diffstat:

 sys/dev/usb/if_urtwn.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 11e4b9ef2a9b -r bcd021ee34bd sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Sun Oct 17 12:17:33 2021 +0200
+++ b/sys/dev/usb/if_urtwn.c    Sun Oct 24 13:22:24 2021 +0200
@@ -567,12 +567,12 @@
 
        DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_uw.uw_dev), __func__));
 
-       usbwifi_detach(self, flags);
-
        usbwifi_set_dying(&sc->sc_uw, true);
 
        callout_halt(&sc->sc_calib_to, NULL);
 
+       usbwifi_detach(self, flags);
+
        if (ISSET(sc->sc_uw.uw_flags, URTWN_FLAG_ATTACHED)) {
                usb_rem_task_wait(sc->sc_uw.uw_udev, &sc->sc_task, USB_TASKQ_DRIVER,
                    NULL);



Home | Main Index | Thread Index | Old Index