diff options
author | Tycho Andersen <tycho@tycho.ws> | 2018-12-13 03:46:54 +0100 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2018-12-14 01:49:01 +0100 |
commit | 319deec7db6c0aab276d2447f778e7cffed24c7c (patch) | |
tree | e1baf753b06d711aa7b3cba52eef2b5178f876a9 /kernel | |
parent | samples: add an example of seccomp user trap (diff) | |
download | linux-319deec7db6c0aab276d2447f778e7cffed24c7c.tar.xz linux-319deec7db6c0aab276d2447f778e7cffed24c7c.zip |
seccomp: fix poor type promotion
sparse complains,
kernel/seccomp.c:1172:13: warning: incorrect type in assignment (different base types)
kernel/seccomp.c:1172:13: expected restricted __poll_t [usertype] ret
kernel/seccomp.c:1172:13: got int
kernel/seccomp.c:1173:13: warning: restricted __poll_t degrades to integer
Instead of assigning this to ret, since we don't use this anywhere, let's
just test it against 0 directly.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Reported-by: 0day robot <lkp@intel.com>
Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace")
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/seccomp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 15b6be97fc09..d7f538847b84 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -1169,8 +1169,7 @@ static __poll_t seccomp_notify_poll(struct file *file, poll_wait(file, &filter->notif->wqh, poll_tab); - ret = mutex_lock_interruptible(&filter->notify_lock); - if (ret < 0) + if (mutex_lock_interruptible(&filter->notify_lock) < 0) return EPOLLERR; list_for_each_entry(cur, &filter->notif->notifications, list) { |