DragonFlyBSD Kernel Audit
DF-2093 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/netif/wi/if_wi_pci.c b/sys/dev/netif/wi/if_wi_pci.c
@@ -176,6 +176,10 @@
 		sc->local_rid = WI_PCI_LOCALRES;
 		sc->local = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
 		    &sc->local_rid, RF_ACTIVE);
+		if (sc->local == NULL) {
+			device_printf(dev, "couldn't allocate PLX I/O port\n");
+			return (ENXIO);
+		}
 		sc->wi_localtag = rman_get_bustag(sc->local);
 		sc->wi_localhandle = rman_get_bushandle(sc->local);
 		command = bus_space_read_4(sc->wi_localtag, sc->wi_localhandle,