summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2012-11-14 02:12:12 +0400
committerTakashi Iwai <tiwai@suse.de>2012-11-14 11:03:31 +0400
commit701ef3205eb33bce4ba97b96f6f04a5ae29cd7b8 (patch)
treebc6c90b94fea09e46f402070f2718141ed23734e /sound
parent9af4e7fedab490fec6e831912859d6be92e9140d (diff)
downloadlinux-701ef3205eb33bce4ba97b96f6f04a5ae29cd7b8.tar.xz
ALSA: core: fix NULL checking in snd_pcm_plug_slave_size()
The dereference snd_pcm_plug_stream(plug) should come after the NULL check snd_BUG_ON(!plug). Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/oss/pcm_plugin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index f0d7b1566a10..727ac44d39f4 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -231,13 +231,14 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc
{
struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next;
snd_pcm_sframes_t frames;
- int stream = snd_pcm_plug_stream(plug);
+ int stream;
if (snd_BUG_ON(!plug))
return -ENXIO;
if (clt_frames == 0)
return 0;
frames = clt_frames;
+ stream = snd_pcm_plug_stream(plug);
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
plugin = snd_pcm_plug_first(plug);
while (plugin && frames > 0) {