From aeead274a105058a6eb84e41cf6d8a32662a3e2c Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 31 Jan 2011 21:16:48 +0000 Subject: [PATCH] Fix an infinite loop in pnp_get_ioresource(), which freezes coreboot if a rare condition arises. Based on findings by Alexandru Gagniuc Signed-off-by: Stefan Reinauer Acked-by: Alexandru Gagniuc git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6323 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/devices/pnp_device.c | 6 ++++++ 1 file changed, 6 insertions(+) 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. */