Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9c0b2af authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Takashi Iwai
Browse files

ALSA: PCM: check if ops are defined before suspending PCM

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: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bb580602
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1520,6 +1520,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;