diff options
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/vx/vx_pcm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 2195e25087b4..c4af84995d05 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) | |||
1253 | 1253 | ||
1254 | /* allocate pipes */ | 1254 | /* allocate pipes */ |
1255 | 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; | ||
1256 | 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); |
1257 | if (! chip->playback_pipes || ! chip->capture_pipes) | 1259 | if (!chip->capture_pipes) { |
1260 | kfree(chip->playback_pipes); | ||
1258 | return -ENOMEM; | 1261 | return -ENOMEM; |
1262 | } | ||
1259 | 1263 | ||
1260 | 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); |
1261 | 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); |