Skip to contentSkip to conversation

Fix kmalloc argument order in um/vdso/vma.c

PATCH Applied Dave Jones 2 participants 3 messages Oct 24, 2011 User-mode Linux (UML)

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

kmalloc size is 1st arg, not second.

arch/um/sys-x86_64/vdso/vma.c +1 -1
index 9495c8d..91f4ec9 100644
@@ -28,7 +28,7 @@ static int __init init_vdso(void)
 
 	um_vdso_addr = task_size - PAGE_SIZE;
 
-	vdsop = kmalloc(GFP_KERNEL, sizeof(struct page *));
+	vdsop = kmalloc(sizeof(struct page *), GFP_KERNEL);
 	if (!vdsop)
 		goto oom;
 
maintainer Applied
#1 lore raw

Am 25.10.2011 00:15, schrieb Dave Jones:

Quoted 3 lines

kmalloc size is 1st arg, not second.

Applied, Thanks!

I'm a bit shocked that this obviously wrong code builds and seems to work. How have you found this?

//richard

author
#2 lore raw
Quoted 8 lines · Richard Weinberger

Am 25.10.2011 00:15, schrieb Dave Jones:

Quoted 3 lines

kmalloc size is 1st arg, not second.

Applied, Thanks!

I'm a bit shocked that this obviously wrong code builds and seems to work.

Both args are the same types, so gcc didn't know any better.

Quoted 1 line

How have you found this?

grep -r kmalloc\(GFP *

Dave