__copy_from_user_inatomic returns the number of bytes that could not be
copied, not an error code. This fixes the test accordingly.
[ Edit by Mathieu Desnoyers: change "ret" type to unsigned long too. ]
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
pagefault_disable();
for (;;) {
char v;
- long ret;
+ unsigned long ret;
ret = __copy_from_user_inatomic(&v,
(__force const char __user *)(addr),
sizeof(v));
- if (unlikely(ret == -EFAULT))
+ if (unlikely(ret > 0))
break;
count++;
if (unlikely(!v))