From: Lin Ming <ming.m.lin@intel.com>
To: Len Brown <lenb@kernel.org>
Cc: Thomas Renninger <trenn@suse.de>,
"Moore, Robert" <robert.moore@intel.com>,
linux-acpi <linux-acpi@vger.kernel.org>
Subject: Re: [RESEND PATCH] ACPICA: fix leak of acpi_os_validate_address
Date: Thu, 13 Aug 2009 11:25:41 +0800 [thread overview]
Message-ID: <1250133941.4044.20.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <1250131948.4044.5.camel@minggr.sh.intel.com>
On Thu, 2009-08-13 at 10:52 +0800, Lin Ming wrote:
> From: Lin Ming <ming.m.lin@intel.com>
> Date: Thu, 13 Aug 2009 10:43:27 +0800
> Subject: [PATCH] ACPICA: fix leak of acpi_os_validate_address
>
> http://bugzilla.kernel.org/show_bug.cgi?id=13620
>
> If the dynamic region is created and added to resource list over and over again,
> it has the potential to be a memory leak by growing the list every time.
>
> This patch fixes the memory leak, as below
>
> 1) add a new field "count" to struct acpi_res_list.
>
> When inserting, if the region(addr, len) is already in the resource
> list, we just increase "count", otherwise, the region is inserted
> with count=1.
>
> When deleting, the "count" is decreased, if it's decreased to 0,
> the region is deleted from the resource list.
>
> With "count", the region with same address and length can only be
> inserted to the resource list once, so prevent potential memory leak.
>
> 2) add a new function acpi_os_invalidate_address, which is called when
> region is deleted.
>
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Forgot to mention that it's applied on top of 2.6.31-rc5.
Lin Ming
next prev parent reply other threads:[~2009-08-13 3:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-13 2:52 [RESEND PATCH] ACPICA: fix leak of acpi_os_validate_address Lin Ming
2009-08-13 3:25 ` Lin Ming [this message]
2009-08-27 17:09 ` Len Brown
2009-08-28 1:17 ` Lin Ming
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=1250133941.4044.20.camel@minggr.sh.intel.com \
--to=ming.m.lin@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=robert.moore@intel.com \
--cc=trenn@suse.de \
/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