summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2012-05-24 19:59:23 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2012-05-24 19:59:23 +0000
commitd380d0365e1897697b6f2c5757b403316938e0d7 (patch)
tree238898e624a331e7a88748429fa0229b13938e76 /sys/dev
parentbbd4f8dfc739c6f13272d61e02acadc4b06d6d34 (diff)
If _MIN > _MAX consider a WordBus resource to be invalid. Fixes a panic on
the IBM x3550-M4. ok mikeb@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 119e1ddddc0..1f08bc49a81 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.232 2012/03/29 06:58:10 mlarkin Exp $ */
+/* $OpenBSD: acpi.c,v 1.233 2012/05/24 19:59:22 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -403,8 +403,12 @@ acpi_getminbus(union acpi_resource *crs, void *arg)
int typ = AML_CRSTYPE(crs);
/* Check for embedded bus number */
- if (typ == LR_WORD && crs->lr_word.type == 2)
+ if (typ == LR_WORD && crs->lr_word.type == 2) {
+ /* If _MIN > _MAX, the resource is considered to be invalid. */
+ if (crs->lr_word._min > crs->lr_word._max)
+ return -1;
*bbn = crs->lr_word._min;
+ }
return 0;
}