[PATCH 01/12] hw_random: mxc-rngc: fix read of uninitialized variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



err is evaluated in a ternary condition on return, but if the while
loop is never entered, it is left uninitialized. Fix this.

Reported-by: clang-analyzer-10
Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/hw_random/mxc-rngc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hw_random/mxc-rngc.c b/drivers/hw_random/mxc-rngc.c
index 3ed25aa61d05..075c20e43745 100644
--- a/drivers/hw_random/mxc-rngc.c
+++ b/drivers/hw_random/mxc-rngc.c
@@ -133,7 +133,7 @@ static int mxc_rngc_data_present(struct hwrng *rng)
 static int mxc_rngc_read(struct hwrng *rng, void *buf, size_t max, bool wait)
 {
 	struct mxc_rngc *rngc = container_of(rng, struct mxc_rngc, rng);
-	unsigned int err;
+	unsigned int err = 0;
 	int count = 0;
 	u32 *data = buf;
 
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux