提交 ac57b849 编写于 作者: A Alexey Dobriyan 提交者: Jaroslav Kysela

[ALSA] vx - Fix memory leak on error path

Modules: Digigram VX core

Noticed by Eric Sesterhenn on kernel-janitors@
Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 1037593c
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册