diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 15:59:14 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 12:20:20 +0100 |
commit | 603bf524aa4cba95e4fcd64dbfffc41f804c65ab (patch) | |
tree | 6ea3abc3f71b3b234c161e1c5744674727176c00 | |
parent | a381a7a66486f11606eccb8866e29848f995278f (diff) | |
download | op-kernel-dev-603bf524aa4cba95e4fcd64dbfffc41f804c65ab.zip op-kernel-dev-603bf524aa4cba95e4fcd64dbfffc41f804c65ab.tar.gz |
[ALSA] pcm - NULL check in snd_pcm_suspend*()
Modules: PCM Midlevel
Add NULL check in snd_pcm_suspend*() so that the caller doesn't have to do it
by itself.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/core/pcm_native.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 263c01a..7bac1cb 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1073,6 +1073,9 @@ int snd_pcm_suspend(struct snd_pcm_substream *substream) int err; unsigned long flags; + if (! substream) + return 0; + snd_pcm_stream_lock_irqsave(substream, flags); err = snd_pcm_action(&snd_pcm_action_suspend, substream, 0); snd_pcm_stream_unlock_irqrestore(substream, flags); @@ -1091,6 +1094,9 @@ int snd_pcm_suspend_all(struct snd_pcm *pcm) struct snd_pcm_substream *substream; int stream, err = 0; + if (! pcm) + return 0; + for (stream = 0; stream < 2; stream++) { for (substream = pcm->streams[stream].substream; substream; substream = substream->next) { |