1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Stop dereferencing 'r' unconditionally. Maybe it is NULL when ISA

mode and using polling mode.
This commit is contained in:
Warner Losh 2001-08-26 04:05:07 +00:00
parent 573722f3f0
commit f711f84740
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82337

View File

@ -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);