Skip to content

Commit

Permalink
drm/mgag200: Fix uninitialized variable delta
Browse files Browse the repository at this point in the history
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 <colin.king@canonical.com>
Fixes: 2545ac9 ("drm/mgag200: Abstract pixel PLL via struct mgag200_pll")
Addresses-Coverity: ("Uninitialized scalar variable")
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20210817163204.494166-1-colin.king@canonical.com
  • Loading branch information
Colin Ian King authored and Thomas Zimmermann committed Aug 18, 2021
1 parent 17d3d3a commit d03a493
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/mgag200/mgag200_pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d03a493

Please sign in to comment.