__copy_from_user_inatomic returns the number of bytes that could not be copied, not an error code. This fixes the test accordingly.
Signed-off-by: Simon Marchi <[email protected]> --- probes/lttng-probe-user.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c index 94ecf2f..a2368b5 100644 --- a/probes/lttng-probe-user.c +++ b/probes/lttng-probe-user.c @@ -41,7 +41,7 @@ long lttng_strlen_user_inatomic(const char *addr) 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)) -- 1.7.1 _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
