patch-2.1.20 linux/fs/nfs/symlink.c

Next file: linux/fs/open.c
Previous file: linux/fs/locks.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.19/linux/fs/nfs/symlink.c linux/fs/nfs/symlink.c
@@ -108,10 +108,12 @@
 	error = nfs_proc_readlink(NFS_SERVER(inode), NFS_FH(inode), &mem,
 		&res, &len, buflen);
 	iput(inode);
-	if (! error) {
-		copy_to_user(buffer, res, len);
-		put_user('\0', buffer + len);
-		error = len;
+	if (!error) {
+		error = copy_to_user(buffer, res, len);
+		if (!error)
+			error = put_user('\0', buffer + len);
+		if (!error)
+			error = len;
 	}
 	kfree(mem);
 	return error;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov