Skip to content

Commit b9c035a

Browse files
Jaska Uimonenbroonie
authored andcommitted
ASoC: topology: Fix using uninitialized pointer
The original patch changed kcontrol_type to a pointer. In some goto cases the pointer is assigned into a struct member as uninitialized and this will cause a runtime error with UBSan even if it isn't a real bug. So initialize the pointer to NULL. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: d29d41e ("ASoC: topology: Add support for multiple kcontrol types to a widget") Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210519100713.879958-1-jaska.uimonen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6033907 commit b9c035a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/soc-topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,
14221422
struct snd_soc_dapm_widget template, *widget;
14231423
struct snd_soc_tplg_ctl_hdr *control_hdr;
14241424
struct snd_soc_card *card = tplg->comp->card;
1425-
unsigned int *kcontrol_type;
1425+
unsigned int *kcontrol_type = NULL;
14261426
struct snd_kcontrol_new *kc;
14271427
int mixer_count = 0;
14281428
int bytes_count = 0;

0 commit comments

Comments
 (0)