]> xenbits.xensource.com Git - seabios.git/commitdiff
acpi_extract: fix off-by-one
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 2 Aug 2012 13:07:23 +0000 (15:07 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 2 Sep 2012 20:20:13 +0000 (16:20 -0400)
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>
tools/acpi_extract.py

index 167a322a3c9b24b4fe8bf21ec64fc906aa787cab..81fa4aa31eef4f8a628ceb47d730a4ad04e1d4af 100755 (executable)
@@ -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