Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Couple fixes to fs/ecryptfs/inode.c

Following was uncovered by compiling the kernel with '-W' flag:

CC [M] fs/ecryptfs/inode.o
fs/ecryptfs/inode.c: In function ‘ecryptfs_lookup’:
fs/ecryptfs/inode.c:304: warning: comparison of unsigned expression < 0 is always false
fs/ecryptfs/inode.c: In function ‘ecryptfs_symlink’:
fs/ecryptfs/inode.c:486: warning: comparison of unsigned expression < 0 is always false

Function ecryptfs_encode_filename() can return -ENOMEM, so change the
variables to plain int, as in the first case the only real use actually
expects int, and in latter case there is no use beoynd the error check.

Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mika Kukkonen and committed by
Linus Torvalds
c381bfcf 1269bc69

+2 -2
+2 -2
fs/ecryptfs/inode.c
··· 282 282 struct dentry *lower_dentry; 283 283 struct vfsmount *lower_mnt; 284 284 char *encoded_name; 285 - unsigned int encoded_namelen; 285 + int encoded_namelen; 286 286 struct ecryptfs_crypt_stat *crypt_stat = NULL; 287 287 struct ecryptfs_mount_crypt_stat *mount_crypt_stat; 288 288 char *page_virt = NULL; ··· 473 473 struct dentry *lower_dir_dentry; 474 474 umode_t mode; 475 475 char *encoded_symname; 476 - unsigned int encoded_symlen; 476 + int encoded_symlen; 477 477 struct ecryptfs_crypt_stat *crypt_stat = NULL; 478 478 479 479 lower_dentry = ecryptfs_dentry_to_lower(dentry);