Whamcloud - gitweb
e4crypt: fix invalid errno comparison with a negative error code
authorTheodore Ts'o <tytso@mit.edu>
Sun, 24 Jun 2018 04:25:14 +0000 (00:25 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 24 Jun 2018 04:25:14 +0000 (00:25 -0400)
Fixes-Coverity-Bug: 1292755
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/e4crypt.c

index 759a082..3efbf6e 100644 (file)
@@ -566,7 +566,7 @@ static void insert_key_into_keyring(const char *keyring, struct salt *salt)
                return;
        } else if ((rc == -1) && (errno != ENOKEY)) {
                printf("keyctl_search failed: %s\n", strerror(errno));
-               if (errno == -EINVAL)
+               if (errno == EINVAL)
                        printf("Keyring [%s] is not available.\n", keyring);
                exit(1);
        }