summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/acpicpu.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-09-18 23:56:46 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-09-18 23:56:46 +0000
commit7b15eb91cf4edbd831f6b12cf4757d08bfd1ca94 (patch)
tree95f39c74675809c3c649305e2ec1050310f7f39d /sys/dev/acpi/acpicpu.c
parent5c113694795dab29c1c3d1d28fd17ee885692fc4 (diff)
If the APIC table (MADT) isn't present then ci_acpi_proc_id won't be set
when acpicpu tries to attach, leading to a NULL dereference. The ACPI processor object on the Dells where this was reported is bogus and useless anyway so apply the same test when deciding whether to attach to processor objects as acpicpu would when matching them to cpus. Problem reported by Eivind Eide (xenofil (at) gmail.com) and Johan Huldtgren (johan+openbsd-bugs (at) huldtgren.com). Testing by Eivind Eide. ok kettenis@ mlarkin@
Diffstat (limited to 'sys/dev/acpi/acpicpu.c')
-rw-r--r--sys/dev/acpi/acpicpu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index 1a9bc4ae67d..9f372c2e89a 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.77 2016/09/16 20:16:06 guenther Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.78 2016/09/18 23:56:45 guenther Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
@@ -699,8 +699,11 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
sc->sc_ci = ci;
break;
}
- if (ci == NULL)
- printf("unable to find cpu %d\n", sc->sc_dev.dv_unit);
+ if (ci == NULL) {
+ printf(": no cpu matching ACPI ID %d\n", sc->sc_cpu);
+ return;
+ }
+
sc->sc_prev_sleep = 1000000;
acpicpu_set_pdc(sc);