summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-09-30 09:19:54 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-02 05:59:55 +0200
commitef1bb8e21b0ad4fe43a76f69ea14b9fd31e4bdee (patch)
treeef7e6e46783ea2fec71a6130aa3ebc12b307dead /drivers
parentd877a4436bb960e6b942510c3de37b9bd048c1ba (diff)
downloadbarebox-ef1bb8e21b0ad4fe43a76f69ea14b9fd31e4bdee.tar.gz
barebox-ef1bb8e21b0ad4fe43a76f69ea14b9fd31e4bdee.tar.xz
hw_random: mxc-rngc: fix read of uninitialized variable
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> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hw_random/mxc-rngc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hw_random/mxc-rngc.c b/drivers/hw_random/mxc-rngc.c
index 3ed25aa61d..075c20e437 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;