From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOCIs-0008F7-5S for barebox@lists.infradead.org; Fri, 02 Oct 2020 04:04:18 +0000 Date: Fri, 2 Oct 2020 06:04:16 +0200 From: Sascha Hauer Message-ID: <20201002040416.GN11648@pengutronix.de> References: <20200930072005.1407-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200930072005.1407-1-a.fatoum@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 01/12] hw_random: mxc-rngc: fix read of uninitialized variable To: Ahmad Fatoum Cc: barebox@lists.infradead.org On Wed, Sep 30, 2020 at 09:19:54AM +0200, Ahmad Fatoum wrote: > 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 > --- > drivers/hw_random/mxc-rngc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks Sascha > > 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 > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox