Skip to content

Commit 0d42d73

Browse files
igor-stoppaJames Morris
authored andcommitted
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>
1 parent dbdb75b commit 0d42d73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/seccomp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static u32 seccomp_run_filters(const struct seccomp_data *sd,
195195
READ_ONCE(current->seccomp.filter);
196196

197197
/* Ensure unexpected behavior doesn't result in failing open. */
198-
if (unlikely(WARN_ON(f == NULL)))
198+
if (WARN_ON(f == NULL))
199199
return SECCOMP_RET_KILL_PROCESS;
200200

201201
if (!sd) {
@@ -297,7 +297,7 @@ static inline pid_t seccomp_can_sync_threads(void)
297297
/* Return the first thread that cannot be synchronized. */
298298
failed = task_pid_vnr(thread);
299299
/* If the pid cannot be resolved, then return -ESRCH */
300-
if (unlikely(WARN_ON(failed == 0)))
300+
if (WARN_ON(failed == 0))
301301
failed = -ESRCH;
302302
return failed;
303303
}

0 commit comments

Comments
 (0)