diff options
author | Igor Stoppa <igor.stoppa@gmail.com> | 2018-09-05 22:34:43 +0200 |
---|---|---|
committer | James Morris <james.morris@microsoft.com> | 2018-09-06 22:29:59 +0200 |
commit | 0d42d73a37ff91028785e42a6bf12fc020a277c1 (patch) | |
tree | 2b4058274e0e6f19c28ee07188822bd4a189f917 /kernel/seccomp.c | |
parent | security: tomoyo: Fix obsolete function (diff) | |
download | linux-0d42d73a37ff91028785e42a6bf12fc020a277c1.tar.xz linux-0d42d73a37ff91028785e42a6bf12fc020a277c1.zip |
seccomp: remove unnecessary unlikely()
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>
Diffstat (limited to 'kernel/seccomp.c')
-rw-r--r-- | kernel/seccomp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index fd023ac24e10..5a2a9af4663e 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -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) { @@ -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; } |