[patch] proc: copy_to_user() returns unsigned

Previous thread: [patch] asus: don't modify bluetooth/wlan on boot by Dan Carpenter on Tuesday, April 6, 2010 - 3:44 am. (3 messages)

Next thread: [GIT] Networking by David Miller on Tuesday, April 6, 2010 - 4:33 am. (1 message)
From: Dan Carpenter
Date: Tuesday, April 6, 2010 - 3:45 am

copy_to_user() returns the number of bytes left to be copied.

This was a typo from: d82ef020cf31504c816803b1def94eb5ff173363
"proc: pagemap: Hold mmap_sem during page walk".

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 0962739..bfb2773 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -799,7 +799,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
 		start_vaddr = end;
 
 		len = min(count, PM_ENTRY_BYTES * pm.pos);
-		if (copy_to_user(buf, pm.buffer, len) < 0) {
+		if (copy_to_user(buf, pm.buffer, len)) {
 			ret = -EFAULT;
 			goto out_free;
 		}
--

From: Minchan Kim
Date: Tuesday, April 6, 2010 - 4:04 am

I got confused when I see the title of patch.
That's because I understood copy_to_user returns unsigned.
Please, change title to describe your patch.

[PATCH] proc : fix wrong usage of copy_to_user's return value.

Maybe you could name it well than me who is a not native English.

Reviewed-by: Minchan Kim <minchan.kim@gmail.com>



-- 
Kind regards,
Minchan Kim
--

From: KOSAKI Motohiro
Date: Tuesday, April 6, 2010 - 4:32 am

Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>


However I don't think this patch is kernel-janitors material. it should
be just merged mainline soon.



--

From: Matt Mackall
Subject:
Date: Tuesday, April 6, 2010 - 8:17 am

Acked-by: Matt Mackall <mpm@selenic.com>

Linus, please take this one too.

-- 
http://selenic.com : development and support for Mercurial and Linux


--

Previous thread: [patch] asus: don't modify bluetooth/wlan on boot by Dan Carpenter on Tuesday, April 6, 2010 - 3:44 am. (3 messages)

Next thread: [GIT] Networking by David Miller on Tuesday, April 6, 2010 - 4:33 am. (1 message)