diff options
author | 2012-05-24 19:59:22 +0000 | |
---|---|---|
committer | 2012-05-24 19:59:22 +0000 | |
commit | 8865606b9444835780b675d5cec13cef7e9985b0 (patch) | |
tree | 848c733640b012d7b1037915c5ea1a1e000f46fc /sys/dev/acpi/acpi.c | |
parent | A couple of trivial spacing and comment fixes. (diff) | |
download | wireguard-openbsd-8865606b9444835780b675d5cec13cef7e9985b0.tar.xz wireguard-openbsd-8865606b9444835780b675d5cec13cef7e9985b0.zip |
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/acpi/acpi.c')
-rw-r--r-- | sys/dev/acpi/acpi.c | 8 |
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; } |