summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-08-08 18:54:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-08-08 18:54:30 +0000
commit4785217b3ea280c4ab5022625967dfbe11411d3e (patch)
tree26a8ac571501c44fedb0cd60c0d7ea3d0de47d4d
parent111e8ee3cfc297d2cf4d2e4d0bbb61970b0f552c (diff)
Prevent a potential null-pointer dereference.
ok krw@, deraadt@
-rw-r--r--sys/arch/amd64/pci/pci_machdep.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c
index bf49a9952e2..597f3274d09 100644
--- a/sys/arch/amd64/pci/pci_machdep.c
+++ b/sys/arch/amd64/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.12 2007/05/21 22:10:45 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.13 2007/08/08 18:54:29 kettenis Exp $ */
/* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -473,12 +473,14 @@ pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
#if NIOAPIC > 0
if (mp_busses != NULL) {
- if (intr_find_mpmapping(mp_isa_bus->mb_idx, line, ihp) == 0) {
+ if (mp_isa_bus != NULL &&
+ intr_find_mpmapping(mp_isa_bus->mb_idx, line, ihp) == 0) {
*ihp |= line;
return 0;
}
#if NEISA > 0
- if (intr_find_mpmapping(mp_eisa_bus->mb_idx, line, ihp) == 0) {
+ if (mp_eisa_bus != NULL &&
+ intr_find_mpmapping(mp_eisa_bus->mb_idx, line, ihp) == 0) {
*ihp |= line;
return 0;
}