mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 01/12] hw_random: mxc-rngc: fix read of uninitialized variable
@ 2020-09-30  7:19 Ahmad Fatoum
  2020-09-30  7:19 ` [PATCH 02/12] globalvar: fix uninitialized read of variable when no nvvars exist Ahmad Fatoum
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2020-09-30  7:19 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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@pengutronix.de>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-10-02  4:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30  7:19 [PATCH 01/12] hw_random: mxc-rngc: fix read of uninitialized variable Ahmad Fatoum
2020-09-30  7:19 ` [PATCH 02/12] globalvar: fix uninitialized read of variable when no nvvars exist Ahmad Fatoum
2020-09-30  7:19 ` [PATCH 03/12] commands: uimage: fix indeterminate exit code of command Ahmad Fatoum
2020-09-30  7:19 ` [PATCH 04/12] watchdog: fix division-by-zero when clock rate == 0 Ahmad Fatoum
2020-09-30  7:19 ` [PATCH 05/12] net: usb: asix: propagate errors from MDIO accessors Ahmad Fatoum
2020-09-30  7:24   ` [PATCH] fixup! " Ahmad Fatoum
2020-10-02  4:04     ` Sascha Hauer
2020-09-30  7:19 ` [PATCH 06/12] digest: sha: remove no-op "erase" of automatic variables Ahmad Fatoum
2020-09-30  7:20 ` [PATCH 07/12] common: memsize: eliminate dead store Ahmad Fatoum
2020-09-30  7:20 ` [PATCH 08/12] USB: musb: remove dead stores Ahmad Fatoum
2020-09-30  7:20 ` [PATCH 09/12] fs: squashfs: remove dead stores for xattr_id Ahmad Fatoum
2020-09-30  7:20 ` [PATCH 10/12] reset: remove dead initialization Ahmad Fatoum
2020-09-30  7:20 ` [PATCH 11/12] sandbox: fix behavior with images >= 4G on 32-bit Ahmad Fatoum
2020-09-30  7:20 ` [PATCH 12/12] blspec: fix dead assignment Ahmad Fatoum
2020-10-02  4:04 ` [PATCH 01/12] hw_random: mxc-rngc: fix read of uninitialized variable Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox