Kernel/x86 - Emarrasing, stray " at the start of the file
[tpg/acess2.git] / Kernel / arch / x86 / mm_phys.c
index a1feb46..cc6857d 100644 (file)
@@ -248,6 +248,13 @@ tPAddr MM_AllocPhys(void)
                Panic("The fuck? Too many pages! (indx = 0x%x)", indx);
        }
        
+       if( indx >= giPageCount ) {
+               Mutex_Release( &glPhysAlloc );
+               Log_Error("PMem", "MM_AllocPhys - indx(%i) > giPageCount(%i)", indx, giPageCount);
+               LEAVE('i', 0);
+               return 0;
+       }
+       
        // Mark page used
        if(gaPageReferences)
                gaPageReferences[ indx ] = 1;

UCC git Repository :: git.ucc.asn.au