[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180718071152.13265-1-const@MakeLinux.com>
Date: Wed, 18 Jul 2018 10:11:52 +0300
From: Constantine Shulyupin <const@...eLinux.com>
To: "Theodore Ts'o" <tytso@....edu>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org (open list)
Cc: Constantine Shulyupin <const@...eLinux.com>
Subject: [PATCH] drivers/char/random.c: fix uninitialized value warning
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@...eLinux.com>
---
drivers/char/random.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 283fe390e878..8e51846d0673 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1896,7 +1896,7 @@ static int
write_pool(struct entropy_store *r, const char __user *buffer, size_t count)
{
size_t bytes;
- __u32 t, buf[16];
+ __u32 t = 0, buf[16];
const char __user *p = buffer;
while (count > 0) {
--
2.17.1
Powered by blists - more mailing lists