sound/: fix some memory leaks
PATCH 1/1 sound/: fix some memory leaks
This patch fixes two memory leaks spotted by the Coverity checker.
---
sound/drivers/serial-u16550.c | 1 + sound/isa/es18xx.c | 1 + sound/pci/cs46xx/dsp_spos.c | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-)
sound/drivers/serial-u16550.c renamed from sound/drivers/serial-u16550.c.old +1 -0
@@ -789,6 +789,7 @@ static int __init snd_uart16550_create(sif ((err =snd_uart16550_detect (uart)) <=0 ) {printk (KERN_ERR "no UART detected at 0x%lx\n" , iobase); +kfree (uart);return -ENODEV ; }
sound/isa/es18xx.c renamed from sound/isa/es18xx.c.old +1 -0
@@ -2083,6 +2083,7 @@ static int __devinit snd_audiodrive_pnp( err =pnp_activate_dev (acard->devc);if (err <0 ) { snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n"); +kfree (cfg);return -EAGAIN ; }snd_printdd ("pnp: port=0x%lx\n" ,pnp_port_start (acard->devc,0 ));
sound/pci/cs46xx/dsp_spos.c renamed from sound/pci/cs46xx/dsp_spos.c.old +7 -3
@@ -237,7 +237,7 @@ struct dsp_spos_instance *cs46xx_dsp_spoif (ins->symbol_table.symbols ==NULL ) {cs46xx_dsp_spos_destroy (chip); -return NULL ; + goto error; } ins->code.offset =0 ;
@@ -246,7 +246,7 @@ struct dsp_spos_instance *cs46xx_dsp_spoif (ins->code.data ==NULL ) {cs46xx_dsp_spos_destroy (chip); -return NULL ; + goto error; } ins->nscb =0 ;
@@ -257,7 +257,7 @@ struct dsp_spos_instance *cs46xx_dsp_spoif (ins->modules ==NULL ) {cs46xx_dsp_spos_destroy (chip); -return NULL ; + goto error; }/* default SPDIF input sample rate
@@ -280,6 +280,10 @@ struct dsp_spos_instance *cs46xx_dsp_spo/* left and right validity bits */ (1 <<13 ) | (1 <<12 );return ins; + +error: +kfree (ins); +return NULL ; }void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
At Mon, 13 Mar 2006 23:26:47 +0100,
Quoted 16 lines · Adrian Bunk
This patch fixes two memory leaks spotted by the Coverity checker.
Signed-off-by Adrian Bunk <[email protected]>---
sound/drivers/serial-u16550.c | 1 + sound/isa/es18xx.c | 1 + sound/pci/cs46xx/dsp_spos.c | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-)
sound/drivers/serial-u16550.c static int __init snd_uart16550_create(s · line 794
Quoted 6 lines
sound/drivers/serial-u16550.c renamed from sound/drivers/serial-u16550.c.old +1
-0@@ -789,6 +789,7 @@ static int __init snd_uart16550_create(sif ((err =snd_uart16550_detect (uart)) <=0 ) {printk (KERN_ERR "no UART detected at 0x%lx\n" , iobase); +kfree (uart);return -ENODEV ; }
This one may leave a requested region after free. It should be snd_uart16550_free(uart), instead.
Others look fine. I'll apply them with the fix above to ALSA tree.
Thanks!
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
At Mon, 13 Mar 2006 23:26:47 +0100,
Quoted 16 lines · Adrian Bunk
This patch fixes two memory leaks spotted by the Coverity checker.
Signed-off-by Adrian Bunk <[email protected]>---
sound/drivers/serial-u16550.c | 1 + sound/isa/es18xx.c | 1 + sound/pci/cs46xx/dsp_spos.c | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-)
sound/drivers/serial-u16550.c static int __init snd_uart16550_create(s · line 794
Quoted 6 lines
sound/drivers/serial-u16550.c renamed from sound/drivers/serial-u16550.c.old +1
-0@@ -789,6 +789,7 @@ static int __init snd_uart16550_create(sif ((err =snd_uart16550_detect (uart)) <=0 ) {printk (KERN_ERR "no UART detected at 0x%lx\n" , iobase); +kfree (uart);return -ENODEV ; }
This one may leave a requested region after free. It should be snd_uart16550_free(uart), instead.
Others look fine. I'll apply them with the fix above to ALSA tree.
Thanks!
Takashi