ASoC: dapm: Check for NULL widget in dapm_update_dai_unlocked
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Wed, 6 Feb 2019 11:13:59 +0000 (11:13 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 6 Feb 2019 15:42:27 +0000 (15:42 +0000)
DAIs linked to the dummy will not have an associated playback/capture
widget, so we need to skip the update in that case.

Fixes: 078a85f2806f ("ASoC: dapm: Only power up active channels from a DAI")
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-dapm.c

index 5b74dffc9c11d6a11b1f9b0104f20e20b326582d..111a23a9708a27cdb4ef8efb0c9c0c6ef9f32b0f 100644 (file)
@@ -2580,6 +2580,9 @@ static int dapm_update_dai_unlocked(struct snd_pcm_substream *substream,
        else
                w = dai->capture_widget;
 
+       if (!w)
+               return 0;
+
        dev_dbg(dai->dev, "Update DAI routes for %s %s\n", dai->name,
                dir == SNDRV_PCM_STREAM_PLAYBACK ? "playback" : "capture");