diff options
-rw-r--r-- | sound/soc/soc-topology.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 5598e891b2b3..986b8b2f90fb 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c | |||
@@ -513,7 +513,7 @@ static void remove_widget(struct snd_soc_component *comp, | |||
513 | */ | 513 | */ |
514 | if (dobj->widget.kcontrol_type == SND_SOC_TPLG_TYPE_ENUM) { | 514 | if (dobj->widget.kcontrol_type == SND_SOC_TPLG_TYPE_ENUM) { |
515 | /* enumerated widget mixer */ | 515 | /* enumerated widget mixer */ |
516 | for (i = 0; i < w->num_kcontrols; i++) { | 516 | for (i = 0; w->kcontrols != NULL && i < w->num_kcontrols; i++) { |
517 | struct snd_kcontrol *kcontrol = w->kcontrols[i]; | 517 | struct snd_kcontrol *kcontrol = w->kcontrols[i]; |
518 | struct soc_enum *se = | 518 | struct soc_enum *se = |
519 | (struct soc_enum *)kcontrol->private_value; | 519 | (struct soc_enum *)kcontrol->private_value; |
@@ -530,7 +530,7 @@ static void remove_widget(struct snd_soc_component *comp, | |||
530 | } | 530 | } |
531 | } else { | 531 | } else { |
532 | /* volume mixer or bytes controls */ | 532 | /* volume mixer or bytes controls */ |
533 | for (i = 0; i < w->num_kcontrols; i++) { | 533 | for (i = 0; w->kcontrols != NULL && i < w->num_kcontrols; i++) { |
534 | struct snd_kcontrol *kcontrol = w->kcontrols[i]; | 534 | struct snd_kcontrol *kcontrol = w->kcontrols[i]; |
535 | 535 | ||
536 | if (dobj->widget.kcontrol_type | 536 | if (dobj->widget.kcontrol_type |