diff mbox

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

Message ID CAOjcEBJ_rC2Vh+XHtsGPPBerQ73QZK5cnFE_Mgp_zh07eem-Zg@mail.gmail.com
State New, archived
Headers show

Commit Message

Xu Cang Nov. 1, 2015, 10:03 p.m. UTC
To make it consistent with other occurrences, check "res" instead of "res < 0".

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
                }