Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1111eae9 authored by Tyler Hicks's avatar Tyler Hicks
Browse files

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: default avatarTyler Hicks <tyhicks@canonical.com>
Reported-by: default avatarKees Cook <keescook@chromium.org>
parent 1101d586
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -283,7 +283,7 @@ ecryptfs_send_message_locked(char *data, int data_len, u8 msg_type,
	int rc;
	int rc;


	rc = ecryptfs_find_daemon_by_euid(&daemon);
	rc = ecryptfs_find_daemon_by_euid(&daemon);
	if (rc || !daemon) {
	if (rc) {
		rc = -ENOTCONN;
		rc = -ENOTCONN;
		goto out;
		goto out;
	}
	}