summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-04-17 15:14:23 +0000
committerjhb <jhb@FreeBSD.org>2007-04-17 15:14:23 +0000
commit99ac3651bd2fa42498b0ae9eec88e89aae117757 (patch)
tree51159e3967ff128defb59acc6d324192b0551dfb /sys/isa
parent8422d21fb88164a386dda2a4fe8768988c149bf4 (diff)
downloadFreeBSD-src-99ac3651bd2fa42498b0ae9eec88e89aae117757.zip
FreeBSD-src-99ac3651bd2fa42498b0ae9eec88e89aae117757.tar.gz
When trying to allocate a PnP BIOS memory resource, the code loops trying
to move up the start address until the allocation succeeds. If the alignment of the resource was 0, then the code would keep trying the same request in an infinite loop and hang. Force the request to always move start up by at least 1 byte each time through the loop.
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/isa_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c
index 72de76c..05f6a5c 100644
--- a/sys/isa/isa_common.c
+++ b/sys/isa/isa_common.c
@@ -147,7 +147,7 @@ isa_find_memory(device_t child, struct isa_config *config,
end = config->ic_mem[i].ir_end,
align = config->ic_mem[i].ir_align;
start + size - 1 <= end && start + size > start;
- start += align) {
+ start += MAX(align, 1)) {
bus_set_resource(child, SYS_RES_MEMORY, i,
start, size);
res[i] = bus_alloc_resource(child,
OpenPOWER on IntegriCloud