public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vmalloc.c fix for 2.4.20-pre8-ac2
@ 2002-09-30 19:08 Art Haas
  0 siblings, 0 replies; only message in thread
From: Art Haas @ 2002-09-30 19:08 UTC (permalink / raw)
  To: linux-kernel

Hi.

I noticed this when building 2.4.20-pre8-ac2 ...

gcc -D__KERNEL__ -I/usr/src/linux-2.4.20-pre8-ac2/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i586
-nostdinc -iwithprefix include -DKBUILD_BASENAME=vmalloc  -c -o
vmalloc.o vmalloc.c
vmalloc.c: In function `get_vm_area':
vmalloc.c:182: warning: passing arg 1 of `kfree' makes pointer from
integer without a cast
vmalloc.c:173: warning: `addr' might be used uninitialized in this
function

I peek at vmalloc.c shows what looks to be a typo. The variable
'area' is allocated by kmalloc(), and 'addr' is a local variable
that hasn't been set. Trying to kfree() it would probably be
a bad thing.

Art Haas

--- linux-2.4.20-pre8-ac2/mm/vmalloc.c.ac2	2002-09-30 11:49:32.000000000 -0500
+++ linux-2.4.20-pre8-ac2/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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-30 19:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-30 19:08 [PATCH] vmalloc.c fix for 2.4.20-pre8-ac2 Art Haas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox