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/aa6b4920d31b
branches:  trunk
changeset: 375165:aa6b4920d31b
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 6e41e60fb6a9 -r aa6b4920d31b 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 @@ urtwn_detach(device_t self, int flags)
 
        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