summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2007-01-13 11:00:56 +0000
committerbde <bde@FreeBSD.org>2007-01-13 11:00:56 +0000
commitab7949c755ac38a6493f16840332fb5a32cf4c56 (patch)
treee967675457c2d5095cb709293ad63957eeec0717 /sys/dev
parent053f91b1b39c7a6ec974200bb7801edf27adb10f (diff)
downloadFreeBSD-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')
-rw-r--r--sys/dev/cy/cy_isa.c5
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
OpenPOWER on IntegriCloud