diff options
author | 2013-12-22 18:55:25 +0000 | |
---|---|---|
committer | 2013-12-22 18:55:25 +0000 | |
commit | e0f3578a0e7ddc2f8814a44ef54b6c77550f661b (patch) | |
tree | 301a53480c46f4fc0c6d1caca13c064b4554f69c | |
parent | Only attach cpu0 on single-processor kernels, to match the expected behaviour. (diff) | |
download | wireguard-openbsd-e0f3578a0e7ddc2f8814a44ef54b6c77550f661b.tar.xz wireguard-openbsd-e0f3578a0e7ddc2f8814a44ef54b6c77550f661b.zip |
Bail out early if the PCI bus number is -1. This means the hardware isn't
there and the AML might reference stuff that isn't there.
-rw-r--r-- | sys/dev/acpi/acpiprt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c index 997684ccf2c..2fe3bce4db8 100644 --- a/sys/dev/acpi/acpiprt.c +++ b/sys/dev/acpi/acpiprt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiprt.c,v 1.43 2010/08/03 22:54:12 kettenis Exp $ */ +/* $OpenBSD: acpiprt.c,v 1.44 2013/12/22 18:55:25 kettenis Exp $ */ /* * Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org> * @@ -107,6 +107,11 @@ acpiprt_attach(struct device *parent, struct device *self, void *aux) sc->sc_bus = acpiprt_getpcibus(sc, sc->sc_devnode); printf(": bus %d (%s)", sc->sc_bus, sc->sc_devnode->parent->name); + if (sc->sc_bus == -1) { + printf("\n"); + return; + } + if (aml_evalnode(sc->sc_acpi, sc->sc_devnode, 0, NULL, &res)) { printf(": no PCI interrupt routing table\n"); return; @@ -120,9 +125,6 @@ acpiprt_attach(struct device *parent, struct device *self, void *aux) printf("\n"); - if (sc->sc_bus == -1) - return; - for (i = 0; i < res.length; i++) acpiprt_prt_add(sc, res.v_package[i]); |