Commit d15f98e5 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] idmouse min() fix

This got caught by gcc on 64bit boxen - IMGSIZE is size_t and that means
range not covered by that of signed 64bit, so we get an unsigned type for
IMGSIZE-*ppos.  On 32bit boxen IMGSIZE-*ppos ends up being loff_t, so the
warning gets silenced.  
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b0a481c7
......@@ -296,7 +296,8 @@ static ssize_t idmouse_read(struct file *file, char __user *buffer, size_t count
return 0;
}
count = min ((loff_t)count, IMGSIZE - (*ppos));
if (count > IMGSIZE - *ppos)
count = IMGSIZE - *ppos;
if (copy_to_user (buffer, dev->bulk_in_buffer + *ppos, count)) {
result = -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment