summaryrefslogtreecommitdiffstats
path: root/sound/drivers/vx/vx_pcm.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-03-31 15:34:58 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-03-31 15:34:58 -0500
commit86579dd06deecfa6ac88d5e84e4d63c397cd6f6d (patch)
treeb4475d3ccde53015ad84a06e4e55e64591171b75 /sound/drivers/vx/vx_pcm.c
parent7ea9ea832212c4a755650f7c7cc1ff0b63292a41 (diff)
parenta0f067802576d4eb4c65d40b8ee7d6ea3c81dd61 (diff)
downloadlinux-stable-86579dd06deecfa6ac88d5e84e4d63c397cd6f6d.tar.gz
linux-stable-86579dd06deecfa6ac88d5e84e4d63c397cd6f6d.tar.bz2
linux-stable-86579dd06deecfa6ac88d5e84e4d63c397cd6f6d.zip
Merge branch 'master'
Diffstat (limited to 'sound/drivers/vx/vx_pcm.c')
-rw-r--r--sound/drivers/vx/vx_pcm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index 464109e421d4..c4af84995d05 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -98,10 +98,9 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs)
{
struct snd_pcm_runtime *runtime = subs->runtime;
- if (runtime->dma_area) {
- vfree(runtime->dma_area);
- runtime->dma_area = NULL;
- }
+
+ vfree(runtime->dma_area);
+ runtime->dma_area = NULL;
return 0;
}
@@ -1254,9 +1253,13 @@ static int vx_init_audio_io(struct vx_core *chip)
/* allocate pipes */
chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL);
+ if (!chip->playback_pipes)
+ return -ENOMEM;
chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL);
- if (! chip->playback_pipes || ! chip->capture_pipes)
+ if (!chip->capture_pipes) {
+ kfree(chip->playback_pipes);
return -ENOMEM;
+ }
memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs);
memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins);