Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: dapm: Make sure we have a card when displaying component widgets

The dummy component is reused for all cards so we special case and don't
bind it to any of them. This means that code like that displaying the
component widgets that tries to look at the card will crash. In the
future we will fix this by ensuring that the dummy component looks like
other components but that is invasive and so not suitable for a fix.
Instead add a special case check here.

Reported-by: Harry Pan <harry.pan@intel.com>
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org

+7
+7
sound/soc/soc-dapm.c
··· 2188 2188 int count = 0; 2189 2189 char *state = "not set"; 2190 2190 2191 + /* card won't be set for the dummy component, as a spot fix 2192 + * we're checking for that case specifically here but in future 2193 + * we will ensure that the dummy component looks like others. 2194 + */ 2195 + if (!cmpnt->card) 2196 + return 0; 2197 + 2191 2198 list_for_each_entry(w, &cmpnt->card->widgets, list) { 2192 2199 if (w->dapm != dapm) 2193 2200 continue;