[SLOF] [PATCH] pci-phb: Fix stack underflow in phb-pci-walk-bridge

Thomas Huth thuth at redhat.com
Fri Sep 23 04:02:37 AEST 2016

The sequence "my-space pci-htype@ pci-out" in phb-pci-walk-bridge
is bugged: pci-htype@ already consumes the my-space item from the
stack, only leaving one item for pci-out. But pci-out needs two
input items on the stack, the PCI address and a character item.
So this rather should be "my-space dup pci-htype@ pci-out" instead.
However, using the output of pci-htype@ as input character for
pci-out also does not make much sense, since this is likely an
unprintable character. So let's simply use a question mark here
instead to indicate that we did not recognize the type of the
PCI device.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1377083
Signed-off-by: Thomas Huth <thuth at redhat.com>
 board-qemu/slof/pci-phb.fs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board-qemu/slof/pci-phb.fs b/board-qemu/slof/pci-phb.fs
index a8fb7ca..f79c5b4 100644
--- a/board-qemu/slof/pci-phb.fs
+++ b/board-qemu/slof/pci-phb.fs
@@ -297,7 +297,7 @@ setup-puid
             0 OF my-space pci-device-setup ENDOF  \ | set up the device
             1 OF my-space pci-bridge-setup ENDOF  \ | set up the bridge
-            dup OF my-space pci-htype@ pci-out ENDOF
+            dup OF my-space [char] ? pci-out ENDOF
     REPEAT drop

More information about the SLOF mailing list