lkml.org 
[lkml]   [1998]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] Re: Bug in vmalloc?
On Mon, 5 Oct 1998, Neil Booth wrote:

>Moreover, vfree calls vmfree_area_pages with this larger size:-
>
>void vfree(void * addr)
>{
> .
> .
> vmfree_area_pages(VMALLOC_VMADDR(tmp->addr), tmp->size);

Trying to free an additional page doesn' t cause problems since
free_area_pmd() and free_area_pte() are smart enough to handle null
pmd/pte.

But yes the right thing to do is this:

--- linux/mm/vmalloc.c Sat Aug 8 15:19:49 1998
+++ /tmp/vmalloc.c Mon Oct 5 15:38:15 1998
@@ -186,7 +186,8 @@
for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) {
if (tmp->addr == addr) {
*p = tmp->next;
- vmfree_area_pages(VMALLOC_VMADDR(tmp->addr), tmp->size);
+ vmfree_area_pages(VMALLOC_VMADDR(tmp->addr),
+ tmp->size - PAGE_SIZE);
kfree(tmp);
return;
}

Andrea[s] Arcangeli



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.039 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site