[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09c63a63-4967-4289-9538-e144842de8c3@gmail.com>
Date: Fri, 11 Aug 2023 19:19:49 +0300
From: Péter Ujfalusi <peter.ujfalusi@...il.com>
To: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Francesco Dolcini <francesco@...cini.it>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Aradhya Bhatia <a-bhatia1@...com>
Subject: Re: [PATCH 01/11] drm/bridge: tc358768: Fix use of uninitialized
variable
On 04/08/2023 13:44, Tomi Valkeinen wrote:
> smatch reports:
>
> drivers/gpu/drm/bridge/tc358768.c:223 tc358768_update_bits() error: uninitialized symbol 'orig'.
>
> Fix this by bailing out from tc358768_update_bits() if the
> tc358768_read() produces an error.
>
> Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver")
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> ---
> drivers/gpu/drm/bridge/tc358768.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c
> index 819a4b6ec2a0..bc97a837955b 100644
> --- a/drivers/gpu/drm/bridge/tc358768.c
> +++ b/drivers/gpu/drm/bridge/tc358768.c
> @@ -216,6 +216,10 @@ static void tc358768_update_bits(struct tc358768_priv *priv, u32 reg, u32 mask,
> u32 tmp, orig;
>
> tc358768_read(priv, reg, &orig);
> +
no need for blank line
> + if (priv->error)
> + return;
> +
> tmp = orig & ~mask;
> tmp |= val & mask;
> if (tmp != orig)
>
--
Péter
Powered by blists - more mailing lists