[PATCH] ext4:cyrpto two minor fixes for checking return value of ext4_get_encryption_info()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To make it consistent with other occurrences, check "res" instead of "res < 0".

diff --git a/fs/ext4/crypto_policy.c b/fs/ext4/crypto_policy.c
index ad05069..a222996 100644
--- a/fs/ext4/crypto_policy.c
+++ b/fs/ext4/crypto_policy.c
@@ -194,7 +194,7 @@ int ext4_inherit_context(struct inode *parent,
struct inode *child)
        int res;

        res = ext4_get_encryption_info(parent);
-       if (res < 0)
+       if (res)
                return res;
        ci = EXT4_I(parent)->i_crypt_info;
        if (ci == NULL)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 52a79d4..6ca06d5 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -968,7 +968,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
        /* Check if the directory is encrypted */
        if (ext4_encrypted_inode(dir)) {
                err = ext4_get_encryption_info(dir);
-               if (err < 0) {
+               if (err) {
                        brelse(bh);
                        return err;
                }
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux