From: Tomi Valkeinen Date: Mon, 30 Sep 2019 10:38:40 +0000 (+0300) Subject: drm/omap: hdmi4: fix use of uninitialized var X-Git-Tag: v5.10.7~2352^2~6^2~1117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bebf00512cc2c2a942a6dc47674bf44b7a3cb681;p=platform%2Fkernel%2Flinux-rpi.git drm/omap: hdmi4: fix use of uninitialized var If use_mclk is false, mclk_mode is written to a register without initialization. This doesn't cause any ill effects as the written value is not used when use_mclk is false. To fix this, write use_mclk only when use_mclk is true. Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20190930103840.18970-8-tomi.valkeinen@ti.com Reviewed-by: Laurent Pinchart --- diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c index 5d5d558..c4ffe96 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c @@ -542,8 +542,9 @@ static void hdmi_core_audio_config(struct hdmi_core_data *core, } /* Set ACR clock divisor */ - REG_FLD_MOD(av_base, - HDMI_CORE_AV_FREQ_SVAL, cfg->mclk_mode, 2, 0); + if (cfg->use_mclk) + REG_FLD_MOD(av_base, HDMI_CORE_AV_FREQ_SVAL, + cfg->mclk_mode, 2, 0); r = hdmi_read_reg(av_base, HDMI_CORE_AV_ACR_CTRL); /*