seccomp: Remove unnecessary ‘NULL’ values from prepared
PATCH 1/1 seccomp: Remove unnecessary ‘NULL’ values from prepared
prepared is assigned first, so it does not need to initialize the assignment.
Signed-off-by Li zeming <[email protected]>
--- kernel/seccomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/seccomp.c +1 -1
@@ -1838,7 +1838,7 @@ static long seccomp_set_mode_filter(unsigned int flags, const char __user *filter) {const unsigned long seccomp_mode =SECCOMP_MODE_FILTER ; -struct seccomp_filter *prepared =NULL ; +struct seccomp_filter *prepared;long ret = -EINVAL ;int listener =-1 ;struct file *listener_f =NULL ;
Signature · 1 line
2.18.2
Quoted 2 lines · Li zeming
prepared is assigned first, so it does not need to initialize the assignment.
I prefer to explicitly initialize variables so that later changes in the code cannot suddenly leave a variable in a surprise state. :) The compiler will do a good job removing redundant and dead stores.
-Kees
Signature · 1 line
Kees Cook