linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/sun4i: hdmi: Fix unitialized variable
@ 2018-10-21 16:34 Maxime Ripard
  2018-10-21 16:34 ` [PATCH 2/2] drm/sun4i: hdmi: Fix double flag assignation Maxime Ripard
  2018-10-24  8:42 ` [PATCH 1/2] drm/sun4i: hdmi: Fix unitialized variable Giulio Benetti
  0 siblings, 2 replies; 5+ messages in thread
From: Maxime Ripard @ 2018-10-21 16:34 UTC (permalink / raw)
  To: linux-arm-kernel

The is_double variable is used to store, and possibly returning to the
calling function, whether it needs to double the rate of the parent clock
or not.

In the case where it does, the variable is affected, but in the case where
it doesn't we return some uninitialized value. Fix this.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
index 3ecffa52c814..cd2348554bac 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
@@ -35,7 +35,7 @@ static unsigned long sun4i_tmds_calc_divider(unsigned long rate,
 {
 	unsigned long best_rate = 0;
 	u8 best_m = 0, m;
-	bool is_double;
+	bool is_double = false;
 
 	for (m = div_offset ?: 1; m < (16 + div_offset); m++) {
 		u8 d;
-- 
2.19.1

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

end of thread, other threads:[~2018-10-29 13:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-21 16:34 [PATCH 1/2] drm/sun4i: hdmi: Fix unitialized variable Maxime Ripard
2018-10-21 16:34 ` [PATCH 2/2] drm/sun4i: hdmi: Fix double flag assignation Maxime Ripard
2018-10-24  8:43   ` Giulio Benetti
2018-10-29 13:22     ` Maxime Ripard
2018-10-24  8:42 ` [PATCH 1/2] drm/sun4i: hdmi: Fix unitialized variable Giulio Benetti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).