[lttng-dev] [PATCH lttng-modules] Fix check in lttng_strlen_user_inatomic

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed Feb 6 11:29:40 EST 2013


* Simon Marchi (simon.marchi at polymtl.ca) wrote:
> __copy_from_user_inatomic returns the number of bytes that could not be
> copied, not an error code. This fixes the test accordingly.

Merged with update (change ret type to unsigned long too) into master,
stable-2.1, stable-2.0.

Good catch !

Mathieu

> 
> Signed-off-by: Simon Marchi <simon.marchi at polymtl.ca>
> ---
>  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
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list