]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
seccomp: fix poor type promotion
authorTycho Andersen <tycho@tycho.ws>
Thu, 13 Dec 2018 02:46:54 +0000 (19:46 -0700)
committerKees Cook <keescook@chromium.org>
Fri, 14 Dec 2018 00:49:01 +0000 (16:49 -0800)
commit319deec7db6c0aab276d2447f778e7cffed24c7c
treee1baf753b06d711aa7b3cba52eef2b5178f876a9
parentfec7b6690541b8128663a13c9586b1daf42b0a6c
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>
kernel/seccomp.c