diff options
author | bde <bde@FreeBSD.org> | 2007-01-13 11:00:56 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2007-01-13 11:00:56 +0000 |
commit | ab7949c755ac38a6493f16840332fb5a32cf4c56 (patch) | |
tree | e967675457c2d5095cb709293ad63957eeec0717 /sys/dev/cy | |
parent | 053f91b1b39c7a6ec974200bb7801edf27adb10f (diff) | |
download | FreeBSD-src-ab7949c755ac38a6493f16840332fb5a32cf4c56.zip FreeBSD-src-ab7949c755ac38a6493f16840332fb5a32cf4c56.tar.gz |
Fixed a panic in the probe. The memory resource was accessed after
releasing it. This seems to have worked until a few days ago, but
now the memory is unmapped.
Diffstat (limited to 'sys/dev/cy')
-rw-r--r-- | sys/dev/cy/cy_isa.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index 8d6df24..a5203a7 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.c @@ -74,7 +74,7 @@ cy_isa_probe(device_t dev) { struct resource *mem_res; cy_addr iobase; - int mem_rid; + int error, mem_rid; if (isa_get_logicalid(dev) != 0) /* skip PnP probes */ return (ENXIO); @@ -96,8 +96,9 @@ cy_isa_probe(device_t dev) cy_outb(iobase, CY_CLEAR_INTR, 0, 0); DELAY(500); + error = (cy_units(iobase, 0) == 0 ? ENXIO : 0); bus_release_resource(dev, SYS_RES_MEMORY, mem_rid, mem_res); - return (cy_units(iobase, 0) == 0 ? ENXIO : 0); + return (error); } static int |