2002-10-01 00:39:11

by Art Haas

[permalink] [raw]
Subject: [PATCH] vmalloc.c patch for 2.4.20-pre8-ac3

Hi.

It looks like the small vmalloc.c patch didn't make it into
2.4.20-pre8-ac3. The patch is needed because the wrong variable
is passed to kfree().

Art Haas

--- linux-2.4.20-pre8-ac3/mm/vmalloc.c.ac3 2002-09-30 18:27:42.000000000 -0500
+++ linux-2.4.20-pre8-ac3/mm/vmalloc.c 2002-09-30 13:59:30.000000000 -0500
@@ -179,7 +179,7 @@

size += PAGE_SIZE;
if (!size) {
- kfree (addr);
+ kfree (area);
return NULL;
}

--
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
-- Benjamin Franklin, Historical Review of Pennsylvania, 1759


2002-10-01 15:15:58

by Dave Jones

[permalink] [raw]
Subject: Re: [PATCH] vmalloc.c patch for 2.4.20-pre8-ac3

On Mon, Sep 30, 2002 at 07:44:32PM -0500, Art Haas wrote:

> --- linux-2.4.20-pre8-ac3/mm/vmalloc.c.ac3 2002-09-30 18:27:42.000000000 -0500
> +++ linux-2.4.20-pre8-ac3/mm/vmalloc.c 2002-09-30 13:59:30.000000000 -0500
> @@ -179,7 +179,7 @@
>
> size += PAGE_SIZE;
> if (!size) {
> - kfree (addr);
> + kfree (area);
> return NULL;
> }

Ick, that's my bad. Fix is correct, though davem suggested testing
for -PAGE_SIZE before we do the kmalloc would be cleaner.
I tend to agree, but didn't get around to doing it.

Dave

--
| Dave Jones. http://www.codemonkey.org.uk