lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 1 Nov 2015 17:03:45 -0500
From:	Xu Cang <cangxumu@...il.com>
To:	linux-ext4@...r.kernel.org
Subject: [PATCH] ext4:cyrpto two minor fixes for checking return value of ext4_get_encryption_info()

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ