Skip to content
Commit dd5abb74 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown
Browse files

ASoC: topology: avoid uninitialized kcontrol_type

When num_kcontrols is zero, widget->dobj.widget.kcontrol_type
gets set to an uninitialized local variable:

sound/soc/soc-topology.c: In function 'soc_tplg_dapm_widget_create':
sound/soc/soc-topology.c:1566:36: error: 'kcontrol_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I could not figure out which of the valid types would be appropriate
here, so this sets it to '0', which is invalid but at least well-defined
here. There is probably a better way to address the issue.

Fixes: eea3dd4f

 ("ASoC: topology: Only free TLV for volume mixers of a widget")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent eea3dd4f
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