lkml.org 
[lkml]   [2001]   [Nov]   [5]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
Patch in this message
/
DateMon, 5 Nov 2001 05:00:21 -0800
FromWilliam Lee Irwin III <>
Subject[PATCH] repair bootmem memory leak
While developing my fresh bootmem, the testing I did to ensure there
were no memory leaks discovered a caller leaking memory:


diff -urN linux-virgin/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- linux-virgin/arch/i386/kernel/setup.c	Fri Oct  5 14:45:00 2001
+++ linux/arch/i386/kernel/setup.c	Sat Oct 27 12:57:39 2001
@@ -926,7 +926,7 @@
 	 * bootmem allocator with an invalid RAM area.
 	 */
 	reserve_bootmem(HIGH_MEMORY, (PFN_PHYS(start_pfn) +
-			 bootmap_size + PAGE_SIZE-1) - (HIGH_MEMORY));
+			 		bootmap_size) - (HIGH_MEMORY));
 
 	/*
 	 * reserve physical page 0 - it's a special BIOS page on many boxes,
reserve_boootmem_core() already ensures that the endpoint of the
interval to reserve is rounded up to a page boundary, and so this
(demonstrably) leaks a page whenever
	PFN_PHYS(start_pfn) + bootmap_size + PAGE_SIZE -1
is not page-aligned.


Cheers,
Bill
-----------------
willir@us.ibm.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 12:12    [W:0.155 / U:0.370 seconds]
©2003-2008 Jasper Spaans