summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@google.com>2011-01-31 21:16:48 +0000
committerMarc Jones <marc.jones@amd.com>2011-01-31 21:16:48 +0000
commitaeead274a105058a6eb84e41cf6d8a32662a3e2c (patch)
treef994df48f59fffeb8c264939f6606f38fe539cf5
parent38b1f3b772456a1b8ccdba97be3e6bac314a9788 (diff)
downloadcoreboot-aeead274a105058a6eb84e41cf6d8a32662a3e2c.tar.xz
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> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6323 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--src/devices/pnp_device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/devices/pnp_device.c b/src/devices/pnp_device.c
index b2bca03232..a6d428abed 100644
--- a/src/devices/pnp_device.c
+++ b/src/devices/pnp_device.c
@@ -170,6 +170,12 @@ static void pnp_get_ioresource(device_t dev, u8 index, struct io_info *info)
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. */