diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2006-03-25 12:08:11 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 17:23:00 +0100 |
commit | bda44e1d168ac76fce5183eb141592fc645c7818 (patch) | |
tree | d6467cd1b7062f18e3366586637e46adc1ba43e4 /sound/oss | |
parent | [PATCH] cpumask: uninline any_online_cpu() (diff) | |
download | linux-bda44e1d168ac76fce5183eb141592fc645c7818.tar.xz linux-bda44e1d168ac76fce5183eb141592fc645c7818.zip |
[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/oss')
-rw-r--r-- | sound/oss/awe_wave.c | 6 |
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) { 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); |