Fix an infinite loop in pnp_get_ioresource(), which freezes coreboot if
a rare condition arises.
Signed-off-by: Alexandru Gagniuc <[email protected]>
---
Index: src/devices/pnp_device.c
===================================================================
--- src/devices/pnp_device.c (revision 6315)
+++ src/devices/pnp_device.c (working copy)
@@ -183,6 +183,12 @@
step = 1 << gran;
/* Find the first bit that moves. */
+ /* If by any chance, 'moving' will be zero when entering the loop
+ * we will never exit it. We need to make sure that execution
+ * continues if/when this conditon arises.
+ * FIXME: Is this the best solution?
+ */
+ if(moving != 0)
while ((moving & step) == 0) {
gran--;
step >>= 1;
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot