Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 -1
+1 -1
fs/ecryptfs/messaging.c
··· 283 283 int rc; 284 284 285 285 rc = ecryptfs_find_daemon_by_euid(&daemon); 286 - if (rc || !daemon) { 286 + if (rc) { 287 287 rc = -ENOTCONN; 288 288 goto out; 289 289 }