Commit 4442b754 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Andrei Vagin

criu/parasite-syscall.c: init a var

Got the following from clang:

>   CC       criu/parasite-syscall.o
> criu/parasite-syscall.c:1494:6: error: variable 'parasite_size' is used
> uninitialized whenever 'if' condition is false
> [-Werror,-Wsometimes-uninitialized]
>         if (seized_native(ctl))
>             ^~~~~~~~~~~~~~~~~~
> criu/parasite-syscall.c:1503:2: note: uninitialized use occurs here
>         parasite_size += ctl->args_size;
>         ^~~~~~~~~~~~~
> criu/parasite-syscall.c:1494:2: note: remove the 'if' if its condition
> is always true
>         if (seized_native(ctl))
>         ^~~~~~~~~~~~~~~~~~~~~~~

I look at the code and I'm still not quite sure whether parasite_size
can end up being uninitialized. Looks like for CONFIG_X86_64 it can.

So, let's initialize it.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 14881342
......@@ -1461,7 +1461,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item,
{
int ret;
struct parasite_ctl *ctl;
unsigned long p, map_exchange_size, parasite_size;
unsigned long p, map_exchange_size, parasite_size = 0;
BUG_ON(item->threads[0].real != pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment