Commit 8b27418f authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Mark Brown

ASoC: rsnd: Add missing initialization of ADG req_rate

If the "clock-frequency" DT property is not found, req_rate is used
uninitialized, and the "audio_clkout" clock will be created with an
arbitrary clock rate.

This uninitialized kernel stack data may leak to userspace through
/sys/kernel/debug/clk/clk_summary, cfr. the value in the "rate" column:

       clock     enable_cnt  prepare_cnt        rate   accuracy   phase
    --------------------------------------------------------------------
     audio_clkout         0            0  4001836240          0 0
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9c66eedc
...@@ -437,7 +437,7 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv, ...@@ -437,7 +437,7 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
struct device *dev = rsnd_priv_to_dev(priv); struct device *dev = rsnd_priv_to_dev(priv);
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
u32 ckr, rbgx, rbga, rbgb; u32 ckr, rbgx, rbga, rbgb;
u32 rate, req_rate, div; u32 rate, req_rate = 0, div;
uint32_t count = 0; uint32_t count = 0;
unsigned long req_48kHz_rate, req_441kHz_rate; unsigned long req_48kHz_rate, req_441kHz_rate;
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment