patch-2.4.15 linux/arch/i386/lib/usercopy.c

Next file: linux/arch/i386/math-emu/fpu_proto.h
Previous file: linux/arch/i386/kernel/time.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.14/linux/arch/i386/lib/usercopy.c linux/arch/i386/lib/usercopy.c
@@ -165,6 +165,8 @@
 	unsigned long res, tmp;
 
 	__asm__ __volatile__(
+		"	testl %0, %0\n"
+		"	jz 3f\n"
 		"	andl %0,%%ecx\n"
 		"0:	repne; scasb\n"
 		"	setne %%al\n"
@@ -173,6 +175,8 @@
 		"1:\n"
 		".section .fixup,\"ax\"\n"
 		"2:	xorl %%eax,%%eax\n"
+		"	jmp 1b\n"
+		"3:	movb $1,%%al\n"
 		"	jmp 1b\n"
 		".previous\n"
 		".section __ex_table,\"a\"\n"

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)