summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-05-19 12:50:12 +0000
committermarcel <marcel@FreeBSD.org>2007-05-19 12:50:12 +0000
commita94f1d62376b502b67c643057c84c06fd7f9bb15 (patch)
treebb55d9a66cb320fbcb9829f997e5537c9c227310
parent6e70ec73e96c07169ddd78621879578601264554 (diff)
downloadFreeBSD-src-a94f1d62376b502b67c643057c84c06fd7f9bb15.zip
FreeBSD-src-a94f1d62376b502b67c643057c84c06fd7f9bb15.tar.gz
Account for the fact that contigmalloc(9) can return a NULL pointer.
Fix the flags argument: M_WAITOK is not a valid flag. Its presence leaves the indication that contigmalloc(9) will not return a NULL pointer. The use of contigmalloc(9) in this place is probably not a good idea given the constraints. It's probably better to lift the constraints and instead add a permanent mapping to the ITR. It's possible that the first 256MB of memory is exhausted when we get here. This fixes a kernel panic on a 16GB rx3600.
-rw-r--r--sys/ia64/ia64/mca.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/ia64/ia64/mca.c b/sys/ia64/ia64/mca.c
index dbec087..bba0bfb 100644
--- a/sys/ia64/ia64/mca.c
+++ b/sys/ia64/ia64/mca.c
@@ -92,6 +92,9 @@ ia64_mca_save_state(int type)
if (mca_info_size[type] == -1)
return;
+ if (mca_info_block == 0)
+ return;
+
while (1) {
mtx_lock_spin(&mca_info_block_lock);
@@ -198,9 +201,9 @@ ia64_mca_init(void)
}
max_size = round_page(max_size);
- if (max_size) {
- p = contigmalloc(max_size, M_TEMP, M_WAITOK, 0ul,
- 256*1024*1024 - 1, PAGE_SIZE, 256*1024*1024);
+ p = (max_size) ? contigmalloc(max_size, M_TEMP, 0, 0ul,
+ 256*1024*1024 - 1, PAGE_SIZE, 256*1024*1024) : NULL;
+ if (p != NULL) {
mca_info_block = IA64_PHYS_TO_RR7(ia64_tpa((u_int64_t)p));
if (bootverbose)
OpenPOWER on IntegriCloud