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/16ab77e101cc
branches:  trunk
changeset: 1025905:16ab77e101cc
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 fc1af38de9f7 -r 16ab77e101cc 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
@@ -566,12 +566,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