提交 bda44e1d 编写于 作者: J Jesper Juhl 提交者: Linus Torvalds

[PATCH] OSS: Fix leak in awe_wave, also remove pointless cast.

Fix resource leak and remove pointless cast of kmalloc return value.
Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 96a9b4d3
......@@ -2944,7 +2944,7 @@ alloc_new_info(void)
{
awe_voice_list *newlist;
newlist = (awe_voice_list *)kmalloc(sizeof(*newlist), GFP_KERNEL);
newlist = kmalloc(sizeof(*newlist), GFP_KERNEL);
if (newlist == NULL) {
printk(KERN_ERR "AWE32: can't alloc info table\n");
return NULL;
......@@ -3547,8 +3547,10 @@ awe_load_guspatch(const char __user *addr, int offs, int size, int pmgr_flag)
smp->checksum_flag = 0;
smp->checksum = 0;
if ((rc = awe_write_wave_data(addr, sizeof_patch, smprec, -1)) < 0)
if ((rc = awe_write_wave_data(addr, sizeof_patch, smprec, -1)) < 0) {
kfree(vrec);
return rc;
}
sf->mem_ptr += rc;
add_sf_sample(sf, smprec);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册