summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2007-09-01 12:18:28 +0000
committernyan <nyan@FreeBSD.org>2007-09-01 12:18:28 +0000
commitd507f1509cb2ad0c8d53a251d48a82e2966acf1a (patch)
tree9a6d5d8b87ad527e76588ccdd72ecb8e7526d9b8 /sys
parent9afb74d04914b9d6ab998cb5c47f761f326e9961 (diff)
downloadFreeBSD-src-d507f1509cb2ad0c8d53a251d48a82e2966acf1a.zip
FreeBSD-src-d507f1509cb2ad0c8d53a251d48a82e2966acf1a.tar.gz
Fix a kernel panic due to a NULL pointer access on pc98.
When any PnP device exists, isa_release_resource() is called with no activated resource. So a bushandle is not allocated yet. Approved by: re (kensmith)
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/isa/isa.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index b4abe7a..a62c658 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -244,11 +244,13 @@ isa_release_resource(device_t bus, device_t child, int type, int rid,
if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
bh = rman_get_bushandle(r);
- for (i = 1; i < bh->bsh_ressz; i++)
- resource_list_release(rl, bus, child, type, rid + i,
- bh->bsh_res[i]);
- if (bh->bsh_res != NULL)
- free(bh->bsh_res, M_DEVBUF);
+ if (bh != NULL) {
+ for (i = 1; i < bh->bsh_ressz; i++)
+ resource_list_release(rl, bus, child, type,
+ rid + i, bh->bsh_res[i]);
+ if (bh->bsh_res != NULL)
+ free(bh->bsh_res, M_DEVBUF);
+ }
}
#endif
return resource_list_release(rl, bus, child, type, rid, r);
OpenPOWER on IntegriCloud