Commit e58e8daa authored by Mark Brown's avatar Mark Brown Committed by Kamal Mostafa

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

commit 47325078 upstream.

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: default avatarHarry Pan <harry.pan@intel.com>
Suggested-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
[ kamal: backport to 4.2-stable ]
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 1c4cd5c5
......@@ -2229,6 +2229,13 @@ static ssize_t dapm_widget_show_codec(struct snd_soc_codec *codec, char *buf)
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 (!codec->component.card)
return 0;
list_for_each_entry(w, &codec->component.card->widgets, list) {
if (w->dapm != &codec->dapm)
continue;
......
Markdown is supported
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