diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2006-11-27 16:32:44 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2006-11-27 16:32:44 +0000 |
commit | 24161faad1a18b988866377a2a63dba92b46f4dc (patch) | |
tree | daf4af88af60f752597d80bd933c043db161598d | |
parent | e724935dfd29bb7478f23400f43ab64b89a0da33 (diff) |
Add check for acpi pointer. This prevents some ugly panics.
ok ketennis.
-rw-r--r-- | sys/dev/acpi/acpiprt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c index 5d06c7c8d9f..d8e7653b5fc 100644 --- a/sys/dev/acpi/acpiprt.c +++ b/sys/dev/acpi/acpiprt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiprt.c,v 1.4 2006/11/27 15:20:26 jordan Exp $ */ +/* $OpenBSD: acpiprt.c,v 1.5 2006/11/27 16:32:43 marco Exp $ */ /* * Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org> * @@ -182,6 +182,10 @@ acpiprt_prt_add(struct acpiprt_softc *sc, struct aml_value *v) irq = aml_val2int(v->v_package[3]); } apic = ioapic_find_bybase(irq); + if (apic == NULL) { + printf("%s: no apic found for irq %d\n", DEVNAME(sc), irq); + return; + } map = malloc(sizeof (struct mp_intr_map), M_DEVBUF, M_NOWAIT); if (map == NULL) |