* Memory leak in 2.4 vmalloc.c get_vm_area
@ 2002-11-18 23:32 Nathan Scott
2002-11-19 12:22 ` Dave Jones
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Scott @ 2002-11-18 23:32 UTC (permalink / raw)
To: alan; +Cc: linux-kernel
hi Alan,
I noticed you recently merged this patch with Marcelo in the
2.4 BK tree (lists you as author, and annotation says it came
from DaveM originally)...
--- 1.10/mm/vmalloc.c Tue Feb 5 06:10:20 2002
+++ 1.11/mm/vmalloc.c Thu Sep 5 05:22:42 2002
@@ -177,6 +177,8 @@
if (!area)
return NULL;
size += PAGE_SIZE;
+ if(!size)
+ return NULL;
addr = VMALLOC_START;
write_lock(&vmlist_lock);
for (p = &vmlist; (tmp = *p) ; p = &tmp->next) {
This looks to me like it introduces a memory leak in the new !size
case - either the "size" bump and test needs to be moved before the
"area" kmalloc, or we need to kfree(area) before returning NULL.
If you like, I'll make a (trivial) patch to do one of these?
cheers.
--
Nathan
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Memory leak in 2.4 vmalloc.c get_vm_area
2002-11-18 23:32 Memory leak in 2.4 vmalloc.c get_vm_area Nathan Scott
@ 2002-11-19 12:22 ` Dave Jones
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jones @ 2002-11-19 12:22 UTC (permalink / raw)
To: Nathan Scott; +Cc: alan, linux-kernel
On Tue, Nov 19, 2002 at 10:32:02AM +1100, Nathan Scott wrote:
> hi Alan,
>
> I noticed you recently merged this patch with Marcelo in the
> 2.4 BK tree (lists you as author, and annotation says it came
> from DaveM originally)...
>
> --- 1.10/mm/vmalloc.c Tue Feb 5 06:10:20 2002
> +++ 1.11/mm/vmalloc.c Thu Sep 5 05:22:42 2002
> @@ -177,6 +177,8 @@
> if (!area)
> return NULL;
> size += PAGE_SIZE;
> + if(!size)
> + return NULL;
> addr = VMALLOC_START;
> write_lock(&vmlist_lock);
> for (p = &vmlist; (tmp = *p) ; p = &tmp->next) {
>
>
> This looks to me like it introduces a memory leak in the new !size
> case - either the "size" bump and test needs to be moved before the
> "area" kmalloc, or we need to kfree(area) before returning NULL.
>
> If you like, I'll make a (trivial) patch to do one of these?
Correct diagnosis. Patch went to Marcelo a while back.
(Which I thought he took). Alan already picked it up iirc.
Will retransmit, as this is -rc material IMO.
Dave
--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-11-19 12:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-18 23:32 Memory leak in 2.4 vmalloc.c get_vm_area Nathan Scott
2002-11-19 12:22 ` Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox