Skip to contentSkip to conversation

Fix bug in fs/ecryptfs/inode.c: ecryptfs_encode_filename() returns int, not unsigned int

PATCH New Mika Kukkonen 1 participant 1 message Oct 27, 2006 Ecrypt file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix bug in fs/ecryptfs/inode.c: ecryptfs_encode_filename() returns int, not unsigned int

[PATCH] Fix bug in fs/ecryptfs/inode.c: ecryptfs_encode_filename()
returns int (with possible negative error value), not unsigned int. Both callers in the file get it wrong (they are also the only callers of this function). Found by gcc extra warning flags (the return value is checked to be < 0, which is pointless with unsigned). Compile tested only, but should be OK, as the value computed in the function internally is int too.

---

fs/ecryptfs/inode.c | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
fs/ecryptfs/inode.c +2 -2
index efdd2b7..692419c 100644
@@ -338,7 +338,7 @@ static struct dentry *ecryptfs_lookup(st
    struct vfsmount *lower_mnt;
    struct dentry *tlower_dentry = NULL;
    char *encoded_name;
-    unsigned int encoded_namelen;
+    int encoded_namelen;
    struct ecryptfs_crypt_stat *crypt_stat = NULL;
    char *page_virt = NULL;
    struct inode *lower_inode;
@@ -520,7 +520,7 @@ static int ecryptfs_symlink(struct inode
    struct dentry *lower_dir_dentry;
    umode_t mode;
    char *encoded_symname;
-    unsigned int encoded_symlen;
+    int encoded_symlen;
    struct ecryptfs_crypt_stat *crypt_stat = NULL;
 
    lower_dentry = ecryptfs_dentry_to_lower(dentry);