Commit 0d42d73a authored by Igor Stoppa's avatar Igor Stoppa Committed by James Morris

seccomp: remove unnecessary unlikely()

WARN_ON() already contains an unlikely(), so it's not necessary to wrap it
into another.
Signed-off-by: default avatarIgor Stoppa <igor.stoppa@huawei.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Cc: linux-security-module@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarJames Morris <james.morris@microsoft.com>
parent dbdb75bd
...@@ -195,7 +195,7 @@ static u32 seccomp_run_filters(const struct seccomp_data *sd, ...@@ -195,7 +195,7 @@ static u32 seccomp_run_filters(const struct seccomp_data *sd,
READ_ONCE(current->seccomp.filter); READ_ONCE(current->seccomp.filter);
/* Ensure unexpected behavior doesn't result in failing open. */ /* Ensure unexpected behavior doesn't result in failing open. */
if (unlikely(WARN_ON(f == NULL))) if (WARN_ON(f == NULL))
return SECCOMP_RET_KILL_PROCESS; return SECCOMP_RET_KILL_PROCESS;
if (!sd) { if (!sd) {
...@@ -297,7 +297,7 @@ static inline pid_t seccomp_can_sync_threads(void) ...@@ -297,7 +297,7 @@ static inline pid_t seccomp_can_sync_threads(void)
/* Return the first thread that cannot be synchronized. */ /* Return the first thread that cannot be synchronized. */
failed = task_pid_vnr(thread); failed = task_pid_vnr(thread);
/* If the pid cannot be resolved, then return -ESRCH */ /* If the pid cannot be resolved, then return -ESRCH */
if (unlikely(WARN_ON(failed == 0))) if (WARN_ON(failed == 0))
failed = -ESRCH; failed = -ESRCH;
return failed; return failed;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment