Skip to content

Commit

Permalink
eCryptfs: Fix redundant error check on ecryptfs_find_daemon_by_euid()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Kees Cook <[email protected]>
  • Loading branch information
tyhicks committed Feb 27, 2013
1 parent 1101d58 commit 1111eae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ecryptfs/messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ ecryptfs_send_message_locked(char *data, int data_len, u8 msg_type,
int rc;

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

0 comments on commit 1111eae

Please sign in to comment.