Index: mtrr_i686.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/mtrr_i686.c,v
retrieving revision 1.26
diff -u -p -u -r1.26 mtrr_i686.c
--- mtrr_i686.c	20 Apr 2012 22:23:24 -0000	1.26
+++ mtrr_i686.c	22 Apr 2012 18:44:51 -0000
@@ -336,14 +336,17 @@ i686_mtrr_init_first(void)
 	    kmem_zalloc(MTRR_I686_NFIXED_SOFT * sizeof(struct mtrr), KM_SLEEP);
 	KASSERT(mtrr_fixed != NULL);
 
-	mtrr_var =
-	    kmem_zalloc(i686_mtrr_vcnt * sizeof(struct mtrr), KM_SLEEP);
-	KASSERT(mtrr_var != NULL);
-
 	mtrr_var_raw = &mtrr_raw[0];
 	mtrr_fixed_raw = &mtrr_raw[MTRR_I686_NVAR_MAX * 2];
 	mtrr_funcs = &i686_mtrr_funcs;
 
+	if (i686_mtrr_vcnt == 0)
+		return;
+
+	mtrr_var =
+	    kmem_zalloc(i686_mtrr_vcnt * sizeof(struct mtrr), KM_SLEEP);
+	KASSERT(mtrr_var != NULL);
+
 	i686_raw2soft();
 }
 
@@ -761,6 +764,8 @@ i686_mtrr_get(struct mtrr *mtrrp, int *n
 static void
 i686_mtrr_commit(void)
 {
+	if (i686_mtrr_vcnt == 0)
+		return;
 
 	i686_soft2raw();
 	kpreempt_disable();