Re: [PATCH] drivers/char/random.c: fix uninitialized value warning

From: Theodore Y. Ts'o
Date: Wed Jul 18 2018 - 11:24:52 EST


On Wed, Jul 18, 2018 at 10:11:52AM +0300, Constantine Shulyupin wrote:
> Local variable t should be initialized by arch_get_random_int.
> Actually on failure of arch_get_random_int, value is not used.
> So, just keep the build clean with less warnings.
>
> warning:
> drivers/char/random.c: In function âwrite_pool.constpropâ:
> drivers/char/random.c:1912:11: warning: âtâ may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Signed-off-by: Constantine Shulyupin <const@xxxxxxxxxxxxx>

There was a more significant problem which Arnd pointed out, which is
I had reversed the sense of the test in arch_get_random_int(). I've
since fixed this, and the current random tree is clean of warnings.

- Ted