Author: mjones Date: Mon Jan 31 22:16:48 2011 New Revision: 6323 URL: https://tracker.coreboot.org/trac/coreboot/changeset/6323
Log: Fix an infinite loop in pnp_get_ioresource(), which freezes coreboot if a rare condition arises.
Based on findings by Alexandru Gagniuc mr.nuke.me@gmail.com
Signed-off-by: Stefan Reinauer reinauer@google.com
Acked-by: Alexandru Gagniuc mr.nuke.me@gmail.com
Modified: trunk/src/devices/pnp_device.c
Modified: trunk/src/devices/pnp_device.c ============================================================================== --- trunk/src/devices/pnp_device.c Mon Jan 31 22:14:02 2011 (r6322) +++ trunk/src/devices/pnp_device.c Mon Jan 31 22:16:48 2011 (r6323) @@ -170,6 +170,12 @@ struct resource *resource; unsigned moving, gran, step;
+ if (!info->mask) { + printk(BIOS_ERR, "ERROR: device %s index %d has no mask.\n", + dev_path(dev), index); + return; + } + resource = new_resource(dev, index);
/* Initilize the resource. */