aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2018-01-18 21:40:25 -0500
committerTyler Hicks <tyhicks@canonical.com>2018-03-28 21:33:29 -0400
commitab13a9218c9883d1f51940b9e720c63ef54a2c07 (patch)
tree15de1ab010f40114b62aedadbce43b581cca4daa
parent3215b9d57a2c75c4305a3956ca303d7004485200 (diff)
ecryptfs: lookup: Don't check if mount_crypt_stat is NULL
mount_crypt_stat is assigned to &ecryptfs_superblock_to_private(ecryptfs_dentry->d_sb)->mount_crypt_stat, and mount_crypt_stat is not the first object in struct ecryptfs_sb_info. mount_crypt_stat is therefore never NULL. At the same time, no crash in ecryptfs_lookup() has been reported, and the lookup functions in other file systems don't check if d_sb is NULL either. Given that, remove the NULL check. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
-rw-r--r--fs/ecryptfs/inode.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 847904aa63a9..97d17eaeba07 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -395,8 +395,7 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode,
395 395
396 mount_crypt_stat = &ecryptfs_superblock_to_private( 396 mount_crypt_stat = &ecryptfs_superblock_to_private(
397 ecryptfs_dentry->d_sb)->mount_crypt_stat; 397 ecryptfs_dentry->d_sb)->mount_crypt_stat;
398 if (mount_crypt_stat 398 if (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) {
399 && (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)) {
400 rc = ecryptfs_encrypt_and_encode_filename( 399 rc = ecryptfs_encrypt_and_encode_filename(
401 &encrypted_and_encoded_name, &len, 400 &encrypted_and_encoded_name, &len,
402 mount_crypt_stat, name, len); 401 mount_crypt_stat, name, len);