⬢ DragonFlyBSD Kernel Audit
DF-5157 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/ath/ath/if_ath.c
+++ b/sys/dev/netif/ath/ath/if_ath.c
@@ -1417,6 +1417,13 @@ ath_detach(struct ath_softc *sc)
 
 	ieee80211_ifdetach(&sc->sc_ic);
 	taskqueue_free(sc->sc_tq);
+	/*
+	 * A tx-completion task drained by taskqueue_free() above may have
+	 * re-armed sc_ledtimer (ath_led_event -> ath_led_blink) *after*
+	 * ath_stop() already cancelled it.  Cancel again now that no task
+	 * can re-arm it, before the HAL and the softc go away.
+	 */
+	callout_cancel(&sc->sc_ledtimer);
 #ifdef ATH_TX99_DIAG
 	if (sc->sc_tx99 != NULL)
 		sc->sc_tx99->detach(sc->sc_tx99);