mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] drm/mgag200: Fix uninitialized variable delta
@ 2021-08-17 16:32 Colin King
  2021-08-17 18:22 ` Thomas Zimmermann
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2021-08-17 16:32 UTC (permalink / raw)
  To: Dave Airlie, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Sam Ravnborg, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 2545ac960364 ("drm/mgag200: Abstract pixel PLL via struct mgag200_pll")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/mgag200/mgag200_pll.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/mgag200/mgag200_pll.c b/drivers/gpu/drm/mgag200/mgag200_pll.c
index 7c903cf19c0d..18f1a6dd019a 100644
--- a/drivers/gpu/drm/mgag200/mgag200_pll.c
+++ b/drivers/gpu/drm/mgag200/mgag200_pll.c
@@ -125,6 +125,7 @@ static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clo
 
 	m = n = p = s = 0;
 	permitteddelta = clock * 5 / 1000;
+	delta = 0xffffffff;
 
 	for (testp = 8; testp > 0; testp /= 2) {
 		if (clock * testp > vcomax)
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-17 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 16:32 [PATCH][next] drm/mgag200: Fix uninitialized variable delta Colin King
2021-08-17 18:22 ` Thomas Zimmermann
2021-08-17 20:11   ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®