aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/lib/uaccess.S
diff options
context:
space:
mode:
authorGerald Schaefer <geraldsc@de.ibm.com>2006-03-07 21:55:37 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-08 14:14:01 -0800
commit331c46591414f7f92b1cec048009abe89892ee79 (patch)
treece19fbf200bcef3d0802f59fb5aed5b17005c089 /arch/s390/lib/uaccess.S
parente96fb230cc97760e448327c0de612cfba94ca7bf (diff)
[PATCH] s390: fix strnlen_user return value
strnlen_user is supposed to return then length count + 1 if no terminating \0 is found, and it should return 0 on exception. Found by David Howells <dhowells@redhat.com>. Signed-off-by: Gerald Schaefer <geraldsc@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/s390/lib/uaccess.S')
-rw-r--r--arch/s390/lib/uaccess.S6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/lib/uaccess.S b/arch/s390/lib/uaccess.S
index 88fc94fe648..5d59e262504 100644
--- a/arch/s390/lib/uaccess.S
+++ b/arch/s390/lib/uaccess.S
@@ -198,12 +198,12 @@ __strnlen_user_asm:
0: srst %r2,%r1
jo 0b
sacf 0
- jh 1f # \0 found in string ?
ahi %r2,1 # strnlen_user result includes the \0
-1: slr %r2,%r3
+ # or return count+1 if \0 not found
+ slr %r2,%r3
br %r14
2: sacf 0
- lhi %r2,-EFAULT
+ slr %r2,%r2 # return 0 on exception
br %r14
.section __ex_table,"a"
.long 0b,2b