diff options
author | imp <imp@FreeBSD.org> | 2001-08-26 04:05:07 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-08-26 04:05:07 +0000 |
commit | c65c80807253fb49bde9ccfd425a10bf3a25b61e (patch) | |
tree | c4550d7fe9ef70c9f15f4b7dd6549a15326c52f8 /sys/pccard/pcic_pci.c | |
parent | 8af6c88ac65de22aacb95baaf6949a1ee6477e96 (diff) | |
download | FreeBSD-src-c65c80807253fb49bde9ccfd425a10bf3a25b61e.zip FreeBSD-src-c65c80807253fb49bde9ccfd425a10bf3a25b61e.tar.gz |
Stop dereferencing 'r' unconditionally. Maybe it is NULL when ISA
mode and using polling mode.
Diffstat (limited to 'sys/pccard/pcic_pci.c')
-rw-r--r-- | sys/pccard/pcic_pci.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c index c1d0c7e..31dede2 100644 --- a/sys/pccard/pcic_pci.c +++ b/sys/pccard/pcic_pci.c @@ -701,7 +701,7 @@ pcic_pci_attach(device_t dev) int rid; struct resource *r = NULL; int error; - u_long irq; + u_long irq = 0; driver_intr_t *intr = NULL; /* @@ -772,6 +772,7 @@ pcic_pci_attach(device_t dev) "No PCI interrupt routed, trying ISA.\n"); } intr = pcic_pci_intr; + irq = rman_get_start(r); } if (sc->csc_route == pcic_iw_isa) { rid = 0; @@ -788,8 +789,7 @@ pcic_pci_attach(device_t dev) intr = pcic_isa_intr; } else { sc->slot_poll = pcic_timeout; - sc->timeout_ch = timeout(sc->slot_poll, (void *) sc, - hz/2); + sc->timeout_ch = timeout(sc->slot_poll, sc, hz/2); device_printf(dev, "Polling mode\n"); intr = NULL; } @@ -809,10 +809,9 @@ pcic_pci_attach(device_t dev) */ sc->irqrid = rid; sc->irqres = r; - sc->irq = rman_get_start(r); + sc->irq = irq; if (intr) { - error = bus_setup_intr(dev, r, INTR_TYPE_AV, intr, - (void *) sc, &sc->ih); + error = bus_setup_intr(dev, r, INTR_TYPE_AV, intr, sc, &sc->ih); if (error) { pcic_dealloc(dev); return (error); |