aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Ripard <[email protected]>2018-10-21 18:34:45 +0200
committerMaxime Ripard <[email protected]>2018-10-29 14:19:51 +0100
commita25b77a1d79774981d9e8eefbb7d15c05cbd301c (patch)
treef47f56085d3a0047b7f281d1d81e55a5e589b588
parent633873e6cb884f903468f81f2e8df8975877fadd (diff)
drm/sun4i: hdmi: Fix unitialized variable
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 <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Reviewed-by: Giulio Benetti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c2
1 files changed, 1 insertions, 1 deletions
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;