Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 319deec7 authored by Tycho Andersen's avatar Tycho Andersen Committed by Kees Cook
Browse files

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: default avatarTycho Andersen <tycho@tycho.ws>
Reported-by: default avatar0day robot <lkp@intel.com>
Fixes: 6a21cc50 ("seccomp: add a return code to trap to userspace")
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent fec7b669
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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) {