⬢ DragonFlyBSD Kernel Audit
DF-3926 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/bwn/siba/siba_core.c
+++ b/sys/dev/netif/bwn/siba/siba_core.c
@@ -1039,9 +1039,13 @@
 static void
 siba_cc_power_init(struct siba_cc *scc)
 {
-	struct siba_softc *siba = scc->scc_dev->sd_bus;
+	struct siba_softc *siba;
 	int maxfreq;
 
+	if (scc->scc_dev == NULL)
+		return;
+	siba = scc->scc_dev->sd_bus;
+
 	if (siba->siba_chipid == 0x4321) {
 		if (siba->siba_chiprev == 0)
 			SIBA_CC_WRITE32(scc, SIBA_CC_CHIPCTL, 0x3a4);
@@ -1068,9 +1072,13 @@
 static void
 siba_cc_powerup_delay(struct siba_cc *scc)
 {
-	struct siba_softc *siba = scc->scc_dev->sd_bus;
+	struct siba_softc *siba;
 	int min;
 
+	if (scc->scc_dev == NULL)
+		return;
+	siba = scc->scc_dev->sd_bus;
+
 	if (siba->siba_type != SIBA_TYPE_PCI ||
 	    !(scc->scc_caps & SIBA_CC_CAPS_PWCTL))
 		return;