diff options
Diffstat (limited to 'sound/drivers/vx/vx_pcm.c')
-rw-r--r-- | sound/drivers/vx/vx_pcm.c | 13 |
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 | |||
98 | static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) | 98 | static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) |
99 | { | 99 | { |
100 | struct snd_pcm_runtime *runtime = subs->runtime; | 100 | struct snd_pcm_runtime *runtime = subs->runtime; |
101 | if (runtime->dma_area) { | 101 | |
102 | vfree(runtime->dma_area); | 102 | vfree(runtime->dma_area); |
103 | runtime->dma_area = NULL; | 103 | runtime->dma_area = NULL; |
104 | } | ||
105 | return 0; | 104 | return 0; |
106 | } | 105 | } |
107 | 106 | ||
@@ -1254,9 +1253,13 @@ static int vx_init_audio_io(struct vx_core *chip) | |||
1254 | 1253 | ||
1255 | /* allocate pipes */ | 1254 | /* allocate pipes */ |
1256 | chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL); | 1255 | chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL); |
1256 | if (!chip->playback_pipes) | ||
1257 | return -ENOMEM; | ||
1257 | chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL); | 1258 | chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL); |
1258 | if (! chip->playback_pipes || ! chip->capture_pipes) | 1259 | if (!chip->capture_pipes) { |
1260 | kfree(chip->playback_pipes); | ||
1259 | return -ENOMEM; | 1261 | return -ENOMEM; |
1262 | } | ||
1260 | 1263 | ||
1261 | memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs); | 1264 | memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs); |
1262 | memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins); | 1265 | memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins); |