summaryrefslogtreecommitdiffstats
path: root/sound/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers')
-rw-r--r--sound/drivers/vx/vx_pcm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index 2195e25087b..c4af84995d0 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -1253,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);