mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] repair bootmem memory leak
Date: Mon, 5 Nov 2001 05:00:21 -0800	[thread overview]
Message-ID: <20011105050021.D26577@holomorphy.com> (raw)

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

                 reply	other threads:[~2001-11-05 13:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011105050021.D26577@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®