Author: hpoussin
Date: Sun May 1 07:57:47 2011
New Revision: 51515
URL:
http://svn.reactos.org/svn/reactos?rev=51515&view=rev
Log:
[freeldr] Handle ramdisks < 8MB
Modified:
trunk/reactos/boot/freeldr/freeldr/disk/ramdisk.c
Modified: trunk/reactos/boot/freeldr/freeldr/disk/ramdisk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/disk/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/disk/ramdisk.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/disk/ramdisk.c [iso-8859-1] Sun May 1 07:57:47
2011
@@ -164,7 +164,10 @@
// Allocate memory for it
//
ChunkSize = 8 * 1024 * 1024;
- Percent = PercentPerChunk = 100 / (gRamDiskSize / ChunkSize);
+ if (gRamDiskSize < ChunkSize)
+ Percent = PercentPerChunk = 0;
+ else
+ Percent = PercentPerChunk = 100 / (gRamDiskSize / ChunkSize);
gRamDiskBase = MmAllocateMemory(gRamDiskSize);
if (!gRamDiskBase)
{