Skip to content

Commit

Permalink
seccomp: remove unnecessary unlikely()
Browse files Browse the repository at this point in the history
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it
into another.

Signed-off-by: Igor Stoppa <igor.stoppa@huawei.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: linux-security-module@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: James Morris <james.morris@microsoft.com>
  • Loading branch information
Igor Stoppa authored and James Morris committed Sep 6, 2018
1 parent dbdb75b commit 0d42d73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/seccomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static u32 seccomp_run_filters(const struct seccomp_data *sd,
READ_ONCE(current->seccomp.filter);

/* 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;

if (!sd) {
Expand Down Expand Up @@ -297,7 +297,7 @@ static inline pid_t seccomp_can_sync_threads(void)
/* Return the first thread that cannot be synchronized. */
failed = task_pid_vnr(thread);
/* If the pid cannot be resolved, then return -ESRCH */
if (unlikely(WARN_ON(failed == 0)))
if (WARN_ON(failed == 0))
failed = -ESRCH;
return failed;
}
Expand Down

0 comments on commit 0d42d73

Please sign in to comment.