From 67b5e090efb225654815fed91020db6cfc16bb19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Imre=20Vad=C3=A1sz?= Date: Sun, 13 Nov 2016 22:36:16 +0100 Subject: [PATCH] if_iwm - Check sc->sc_attached flag in suspend/resume callbacks. * There is (almost) nothing to do in suspend/resume if if_iwm has failed during initialization (e.g. because of firmware load failure) and was already uninitialized by iwm_detach_local(). --- sys/dev/netif/iwm/if_iwm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/netif/iwm/if_iwm.c b/sys/dev/netif/iwm/if_iwm.c index 63fdd31789..5e24aa9612 100644 --- a/sys/dev/netif/iwm/if_iwm.c +++ b/sys/dev/netif/iwm/if_iwm.c @@ -6363,6 +6363,10 @@ iwm_resume(device_t dev) * PCI Tx retries from interfering with C3 CPU state. */ pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); + + if (!sc->sc_attached) + return 0; + iwm_init_task(device_get_softc(dev)); IWM_LOCK(sc); @@ -6386,6 +6390,9 @@ iwm_suspend(device_t dev) do_stop = !! (sc->sc_ic.ic_nrunning > 0); + if (!sc->sc_attached) + return (0); + ieee80211_suspend_all(&sc->sc_ic); if (do_stop) { -- 2.11.4.GIT