diff options
author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2023-09-06 09:50:49 +0300 |
---|---|---|
committer | Robert Foss <rfoss@kernel.org> | 2023-09-20 14:48:35 +0300 |
commit | a2d9036615f0adfa5b0a46bb2ce42ef1d9a04fbe (patch) | |
tree | 74227f5cd49f70a668ef5c1e801bb323ef91af57 /drivers/gpu/drm/bridge | |
parent | 1716b1891e1de05e2c20ccafa9f58550f3539717 (diff) | |
download | linux-a2d9036615f0adfa5b0a46bb2ce42ef1d9a04fbe.tar.xz |
drm/bridge: tc358768: Fix use of uninitialized variable
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")
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com> # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-2-31725f008a50@ideasonboard.com
Diffstat (limited to 'drivers/gpu/drm/bridge')
-rw-r--r-- | drivers/gpu/drm/bridge/tc358768.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); + + if (priv->error) + return; + tmp = orig & ~mask; tmp |= val & mask; if (tmp != orig) |