Re: [PATCH] io_uring: fix two assignments in if conditions

From: Xinghui Li
Date: Wed Nov 02 2022 - 04:06:48 EST




在 2022/11/1 23:10,“kernel test robot”<lkp@xxxxxxxxx> 写入:

> Hi,
>
> Thank you for the patch! Perhaps something to improve:
>
> ......
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All warnings (new ones prefixed by >>):
>
> >> io_uring/poll.c:601:7: warning: variable 'apoll' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> if (entry != NULL)
> ^~~~~~~~~~~~~
> io_uring/poll.c:608:2: note: uninitialized use occurs here
> apoll->double_poll = NULL;
> ^~~~~
> io_uring/poll.c:601:3: note: remove the 'if' if its condition is always true
> if (entry != NULL)
> ^~~~~~~~~~~~~~~~~~
> io_uring/poll.c:594:26: note: initialize the variable 'apoll' to silence this warning
> struct async_poll *apoll;
> ^
> = NULL
> 1 warning generated.
>
>
> vim +601 io_uring/poll.c
>
It is do a problem, I will sent v2.
Thanks a lot!
--
0-DAY CI Kernel Test Service
https://01.org/lkp