aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-03-25 06:08:11 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:23:00 -0500
commitbda44e1d168ac76fce5183eb141592fc645c7818 (patch)
treed6467cd1b7062f18e3366586637e46adc1ba43e4 /sound
parent96a9b4d31eba4722ba7aad2cc15118a7799f499f (diff)
[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: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/oss/awe_wave.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/oss/awe_wave.c b/sound/oss/awe_wave.c
index b3ea719d33db..d1a0eb294d6f 100644
--- a/sound/oss/awe_wave.c
+++ b/sound/oss/awe_wave.c
@@ -2944,7 +2944,7 @@ alloc_new_info(void)
2944{ 2944{
2945 awe_voice_list *newlist; 2945 awe_voice_list *newlist;
2946 2946
2947 newlist = (awe_voice_list *)kmalloc(sizeof(*newlist), GFP_KERNEL); 2947 newlist = kmalloc(sizeof(*newlist), GFP_KERNEL);
2948 if (newlist == NULL) { 2948 if (newlist == NULL) {
2949 printk(KERN_ERR "AWE32: can't alloc info table\n"); 2949 printk(KERN_ERR "AWE32: can't alloc info table\n");
2950 return NULL; 2950 return NULL;
@@ -3547,8 +3547,10 @@ awe_load_guspatch(const char __user *addr, int offs, int size, int pmgr_flag)
3547 smp->checksum_flag = 0; 3547 smp->checksum_flag = 0;
3548 smp->checksum = 0; 3548 smp->checksum = 0;
3549 3549
3550 if ((rc = awe_write_wave_data(addr, sizeof_patch, smprec, -1)) < 0) 3550 if ((rc = awe_write_wave_data(addr, sizeof_patch, smprec, -1)) < 0) {
3551 kfree(vrec);
3551 return rc; 3552 return rc;
3553 }
3552 sf->mem_ptr += rc; 3554 sf->mem_ptr += rc;
3553 add_sf_sample(sf, smprec); 3555 add_sf_sample(sf, smprec);
3554 3556