Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / s390 / lib / uaccess64.S
index 0ca5697..19b41a3 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <linux/errno.h>
 #include <asm/lowcore.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
         .text
         .align 4
@@ -194,12 +194,12 @@ __strnlen_user_asm:
 0:     srst    %r2,%r1
        jo      0b
        sacf    0
-       jh      1f              # \0 found in string ?
        aghi    %r2,1           # strnlen_user result includes the \0
-1:     slgr    %r2,%r3
+                               # or return count+1 if \0 not found
+       slgr    %r2,%r3
        br      %r14
 2:     sacf    0
-       lghi    %r2,-EFAULT
+       slgr    %r2,%r2         # return 0 on exception
        br      %r14
        .section __ex_table,"a"
        .quad   0b,2b