diff options
author | Ranjani Sridharan <ranjani.sridharan@linux.intel.com> | 2019-02-09 02:29:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-05 23:29:11 +0300 |
commit | 9b5a341e6ebfdb3fecadb78e11e6560d4afc392b (patch) | |
tree | 7d5bb0ca8c3bc395cbc9d657f6c041e081b08d2d /sound | |
parent | 1de344caee73ec863de5e9ead6665aea83857def (diff) | |
download | linux-9b5a341e6ebfdb3fecadb78e11e6560d4afc392b.tar.xz |
ALSA: PCM: check if ops are defined before suspending PCM
[ Upstream commit d9c0b2afe820fa3b3f8258a659daee2cc71ca3ef ]
BE dai links only have internal PCM's and their substream ops may
not be set. Suspending these PCM's will result in their
ops->trigger() being invoked and cause a kernel oops.
So skip suspending PCM's if their ops are NULL.
[ NOTE: this change is required now for following the recent PCM core
change to get rid of snd_pcm_suspend() call. Since DPCM BE takes
the runtime carried from FE while keeping NULL ops, it can hit this
bug. See details at:
https://github.com/thesofproject/linux/pull/582
-- tiwai ]
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_native.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index e1138e70dbb3..f5eb10f8021c 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1346,6 +1346,14 @@ int snd_pcm_suspend_all(struct snd_pcm *pcm) /* FIXME: the open/close code should lock this as well */ if (substream->runtime == NULL) continue; + + /* + * Skip BE dai link PCM's that are internal and may + * not have their substream ops set. + */ + if (!substream->ops) + continue; + err = snd_pcm_suspend(substream); if (err < 0 && err != -EBUSY) return err; |