diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2019-06-03 09:58:31 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2019-06-03 09:58:31 +0000 |
| commit | 9080eaf550242b9e48da2f9cffa603ba1394cd5c (patch) | |
| tree | b7e5d1003c9a40a80a0e224b6966bd202b19e5f5 /sys/dev | |
| parent | ec3bfe00c2ef2646f6c7b02db590fec0b322b466 (diff) | |
Fix the detach path to prevent panic:
- Fix athn_usb_free_tx_list(). usc->usc_tx_bcn->xfer is freed in the above
for () loop, so remove the if block. OK'd by skrll.
- Add missing athn_usb_free_tx_msg().
- Add missing athn_usb_stop().
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/if_athn_usb.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c index 6fdcb913151..82a00688f58 100644 --- a/sys/dev/usb/if_athn_usb.c +++ b/sys/dev/usb/if_athn_usb.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_athn_usb.c,v 1.33 2019/06/03 09:56:08 msaitoh Exp $ */ +/* $NetBSD: if_athn_usb.c,v 1.34 2019/06/03 09:58:31 msaitoh Exp $ */ /* $OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $ */ /*- @@ -22,7 +22,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.33 2019/06/03 09:56:08 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.34 2019/06/03 09:58:31 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -508,6 +508,7 @@ athn_usb_detach(device_t self, int flags) athn_usb_wait_async(usc); + athn_usb_stop(&sc->sc_if, 0); usb_rem_task_wait(usc->usc_udev, &usc->usc_task, USB_TASKQ_DRIVER, NULL); @@ -523,6 +524,7 @@ athn_usb_detach(device_t self, int flags) athn_usb_free_rx_list(usc); athn_usb_free_tx_list(usc); athn_usb_free_tx_cmd(usc); + athn_usb_free_tx_msg(usc); /* Close Tx/Rx pipes. */ athn_usb_close_pipes(usc); @@ -764,10 +766,6 @@ athn_usb_free_tx_list(struct athn_usb_softc *usc) if (xfer != NULL) usbd_destroy_xfer(xfer); } - if (usc->usc_tx_bcn) { - usbd_destroy_xfer(usc->usc_tx_bcn->xfer); - usc->usc_tx_bcn = NULL; - } } Static int |
