All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: PCM: check if ops are defined before suspending PCM
@ 2019-02-08 23:29 Pierre-Louis Bossart
  2019-02-09  9:27 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre-Louis Bossart @ 2019-02-08 23:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Ranjani Sridharan, Pierre-Louis Bossart, liam.r.girdwood,
	vkoul, broonie

From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

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.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/core/pcm_native.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 818dff1de545..b6e158ce6650 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1506,6 +1506,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;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-02-12 20:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-08 23:29 [PATCH] ALSA: PCM: check if ops are defined before suspending PCM Pierre-Louis Bossart
2019-02-09  9:27 ` Takashi Iwai
2019-02-11 15:41   ` Pierre-Louis Bossart
2019-02-11 16:05     ` Takashi Iwai
2019-02-11 16:59       ` Pierre-Louis Bossart
2019-02-12 16:20         ` Mark Brown
2019-02-12 20:48   ` Ranjani Sridharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.