summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdike <jdike>2003-08-07 18:58:11 +0000
committerjdike <jdike>2003-08-07 18:58:11 +0000
commitbd830e90fb9a5e82f89d15122137b260d5b5e0c9 (patch)
tree75b69a163bf5b6f3e6573dd2ffa32a1fb69322d8
parentc1d2e936778ef9e36685cc1239a9abb086437d97 (diff)
downloaduml-history-bd830e90fb9a5e82f89d15122137b260d5b5e0c9.tar.gz
Improved the error message that you get if you specify a rediculously small
amount of memory.
-rw-r--r--arch/um/kernel/mem_user.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/um/kernel/mem_user.c b/arch/um/kernel/mem_user.c
index 8f1f011..cf17c0a 100644
--- a/arch/um/kernel/mem_user.c
+++ b/arch/um/kernel/mem_user.c
@@ -111,6 +111,11 @@ int setup_region(struct mem_region *region, void *entry)
offset = 0;
}
+ if(offset >= region->len){
+ printf("%d bytes of physical memory is insufficient\n",
+ region->len);
+ exit(1);
+ }
loc = mmap(start, region->len - offset, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_FIXED, region->fd, offset);
if(loc != start){