patch-2.4.20 linux-2.4.20/arch/mips/kernel/sysmips.c

Next file: linux-2.4.20/arch/mips/kernel/time.c
Previous file: linux-2.4.20/arch/mips/kernel/sysirix.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/arch/mips/kernel/sysmips.c linux-2.4.20/arch/mips/kernel/sysmips.c
@@ -61,13 +61,13 @@
 		name = (char *) arg1;
 
 		len = strncpy_from_user(nodename, name, sizeof(nodename));
-		if (len < 0) 
+		if (len < 0)
 			return -EFAULT;
 
 		down_write(&uts_sem);
 		strncpy(system_utsname.nodename, name, len);
+		system_utsname.nodename[len] = '\0';
 		up_write(&uts_sem);
-		system_utsname.nodename[len] = '\0'; 
 		return 0;
 	}
 

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