patch-2.4.23 linux-2.4.23/fs/jfs/jfs_unicode.c

Next file: linux-2.4.23/fs/jfs/jfs_xtree.c
Previous file: linux-2.4.23/fs/jfs/jfs_txnmgr.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/fs/jfs/jfs_unicode.c linux-2.4.23/fs/jfs/jfs_unicode.c
@@ -68,8 +68,7 @@
 			jfs_err("jfs_strtoUCS: char2uni returned %d.", charlen);
 			jfs_err("charset = %s, char = 0x%x",
 				codepage->charset, (unsigned char) *from);
-			to[i] = 0x003f;	/* a question mark */
-			charlen = 1;
+			return charlen;
 		}
 	}
 
@@ -89,16 +88,21 @@
 	int length = dentry->d_name.len;
 
 	if (length > JFS_NAME_MAX)
-		return ENAMETOOLONG;
+		return -ENAMETOOLONG;
 
 	uniName->name =
 	    kmalloc((length + 1) * sizeof(wchar_t), GFP_NOFS);
 
 	if (uniName->name == NULL)
-		return ENOSPC;
+		return -ENOSPC;
 
 	uniName->namlen = jfs_strtoUCS(uniName->name, dentry->d_name.name,
 				       length, nls_tab);
 
+	if (uniName->namlen < 0) {
+		kfree(uniName->name);
+		return uniName->namlen;
+	}
+
 	return 0;
 }

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