Skip to content

Commit d03a493

Browse files
Colin Ian KingThomas Zimmermann
authored andcommitted
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: 2545ac9 ("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]
1 parent 17d3d3a commit d03a493

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/mgag200/mgag200_pll.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clo
124124
unsigned int computed;
125125

126126
m = n = p = s = 0;
127+
delta = 0xffffffff;
127128
permitteddelta = clock * 5 / 1000;
128129

129130
for (testp = 8; testp > 0; testp /= 2) {

0 commit comments

Comments
 (0)