aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <[email protected]>2021-08-17 17:32:04 +0100
committerThomas Zimmermann <[email protected]>2021-08-18 20:47:59 +0200
commitd03a493f6782b94b7002388d470cb583e061816a (patch)
tree0a244c1b6df720acb96bd73caa6f14ab9eba903a
parent17d3d3a6146c72c7b2e1aa97191bbefce167e0ad (diff)
drm/mgag200: Fix uninitialized variable delta
The variable delta is not initialized and this will cause unexpected behaviour with the comparison of tmpdelta < delta. Fix this by setting it to 0xffffffff. This matches the behaviour as in the similar function mgag200_pixpll_compute_g200se_04. v2: * move fix up by one line to align style with other functions * add additional tags from similar patch Signed-off-by: Colin Ian King <[email protected]> Fixes: 2545ac960364 ("drm/mgag200: Abstract pixel PLL via struct mgag200_pll") Addresses-Coverity: ("Uninitialized scalar variable") Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Dave Airlie <[email protected]> Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_pll.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_pll.c b/drivers/gpu/drm/mgag200/mgag200_pll.c
index 7c903cf19c0d..e9ae22b4f813 100644
--- a/drivers/gpu/drm/mgag200/mgag200_pll.c
+++ b/drivers/gpu/drm/mgag200/mgag200_pll.c
@@ -124,6 +124,7 @@ static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clo
unsigned int computed;
m = n = p = s = 0;
+ delta = 0xffffffff;
permitteddelta = clock * 5 / 1000;
for (testp = 8; testp > 0; testp /= 2) {