Commit 7061b8a5 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown

ASoC: cros_ec_codec: fix uninitialized memory read

gcc points out a memory area that is copied to a device
but not initialized:

sound/soc/codecs/cros_ec_codec.c: In function 'i2s_rx_event':
arch/x86/include/asm/string_32.h:83:20: error: '*((void *)&p+4)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   83 |   *((int *)to + 1) = *((int *)from + 1);

Initialize all the unused fields to zero.

Fixes: 727f1c71 ("ASoC: cros_ec_codec: refactor I2S RX")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarTzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201203225458.1477830-1-arnd@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 518a760c
...@@ -332,7 +332,7 @@ static int i2s_rx_event(struct snd_soc_dapm_widget *w, ...@@ -332,7 +332,7 @@ static int i2s_rx_event(struct snd_soc_dapm_widget *w,
snd_soc_dapm_to_component(w->dapm); snd_soc_dapm_to_component(w->dapm);
struct cros_ec_codec_priv *priv = struct cros_ec_codec_priv *priv =
snd_soc_component_get_drvdata(component); snd_soc_component_get_drvdata(component);
struct ec_param_ec_codec_i2s_rx p; struct ec_param_ec_codec_i2s_rx p = {};
switch (event) { switch (event) {
case SND_SOC_DAPM_PRE_PMU: case SND_SOC_DAPM_PRE_PMU:
......
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