]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/soc-dapm.c
ASoC: dapm: Make sure we have a card when displaying component widgets
[karo-tx-linux.git] / sound / soc / soc-dapm.c
index 416514fe9e6350a80fcdf60770a9079029a687cb..afb70a5d4fd3552964917abe09a88c60e0f8c8d7 100644 (file)
@@ -2188,6 +2188,13 @@ static ssize_t dapm_widget_show_component(struct snd_soc_component *cmpnt,
        int count = 0;
        char *state = "not set";
 
+       /* card won't be set for the dummy component, as a spot fix
+        * we're checking for that case specifically here but in future
+        * we will ensure that the dummy component looks like others.
+        */
+       if (!cmpnt->card)
+               return 0;
+
        list_for_each_entry(w, &cmpnt->card->widgets, list) {
                if (w->dapm != dapm)
                        continue;