summaryrefslogtreecommitdiff
path: root/sound/core/pcm_native.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-07-04 16:08:05 +0300
committerTakashi Iwai <tiwai@suse.de>2018-07-04 16:34:59 +0300
commite647f5a5c5d165c87750e8c0dcbe341b5a378ffd (patch)
treeea8b6fe2e8fb03060f2886fe4166a1014d25154b /sound/core/pcm_native.c
parent9cd641ed31f576d08f7b784850ba93eef050f32f (diff)
downloadlinux-e647f5a5c5d165c87750e8c0dcbe341b5a378ffd.tar.xz
ALSA: pcm: Use snd_pcm_stop_xrun() for xrun injection
Basically the xrun injection routine can simply call the standard helper snd_pcm_stop_xrun(), but with one exception: it may be called even when the stream is closed. Make snd_pcm_stop_xrun() more robust and check the NULL runtime state, and simplify xrun injection code by calling it. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r--sound/core/pcm_native.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 20174d0c0527..66c90f486af9 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1339,7 +1339,7 @@ int snd_pcm_stop_xrun(struct snd_pcm_substream *substream)
unsigned long flags;
snd_pcm_stream_lock_irqsave(substream, flags);
- if (snd_pcm_running(substream))
+ if (substream->runtime && snd_pcm_running(substream))
__snd_pcm_xrun(substream);
snd_pcm_stream_unlock_irqrestore(substream, flags);
return 0;