Skip to content

Commit 1111eae

Browse files
committed
eCryptfs: Fix redundant error check on ecryptfs_find_daemon_by_euid()
It is sufficient to check the return code of ecryptfs_find_daemon_by_euid(). If it returns 0, it always sets the daemon pointer to point to a valid ecryptfs_daemon. Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Reported-by: Kees Cook <keescook@chromium.org>
1 parent 1101d58 commit 1111eae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/ecryptfs/messaging.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ ecryptfs_send_message_locked(char *data, int data_len, u8 msg_type,
283283
int rc;
284284

285285
rc = ecryptfs_find_daemon_by_euid(&daemon);
286-
if (rc || !daemon) {
286+
if (rc) {
287287
rc = -ENOTCONN;
288288
goto out;
289289
}

0 commit comments

Comments
 (0)