Skip to contentSkip to conversation

Fix check in lttng_strlen_user_inatomic

PATCH Mathieu Desnoyers 1 participant 1 message Feb 6, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 2 lines · * Simon Marchi ([email protected]) 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

Quoted 27 lines
---
 probes/lttng-probe-user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
probes/lttng-probe-user.c +1 -1
index 94ecf2f..a2368b5 100644
@@ -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))
Signature · 7 lines
1.7.1


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com