aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-08-02 15:07:23 +0200
committerKevin O'Connor <kevin@koconnor.net>2012-09-02 16:20:13 -0400
commitf960782978d7376224f23afb70ad05c77b330cc4 (patch)
treee2e74b72bd1f045c7a4663da3ec33494f388271b
parentc8ed45e67d282d65f5580f823004bcfcbd4e31b6 (diff)
downloadseabios-f960782978d7376224f23afb70ad05c77b330cc4.tar.gz
acpi_extract: fix off-by-one
Single-byte package length values do use bits 4-5, and this will happen with the PCI hotplug devices. pkglenbytes has not yet been decremented, so multi-byte values are detected with pkglenbytes > 1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rwxr-xr-xtools/acpi_extract.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/acpi_extract.py b/tools/acpi_extract.py
index 167a322..81fa4aa 100755
--- a/tools/acpi_extract.py
+++ b/tools/acpi_extract.py
@@ -93,7 +93,7 @@ def aml_pkglen(offset):
pkglenbytes = aml_pkglen_bytes(offset)
pkglen = aml[offset] & 0x3F
# If multibyte, first nibble only uses bits 0-3
- if ((pkglenbytes > 0) and (pkglen & 0x30)):
+ if ((pkglenbytes > 1) and (pkglen & 0x30)):
die("PkgLen bytes 0x%x but first nibble 0x%x expected 0x0X" %
(pkglen, pkglen))
offset += 1