Fix check in lttng_strlen_user_inatomic
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 6 Feb 2013 16:26:59 +0000 (11:26 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 6 Feb 2013 16:26:59 +0000 (11:26 -0500)
__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>
probes/lttng-probe-user.c

index 94ecf2f1cffb339d53d9c1dc4d62f58a13dc9ece..d0b5cf297367ce3c209b69ecb491e969ec321270 100644 (file)
@@ -36,12 +36,12 @@ long lttng_strlen_user_inatomic(const char *addr)
        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))
This page took 0.031535 seconds and 4 git commands to generate.