aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-03-14 03:44:19 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:38:23 -0500
commit202728d783a0fc180e7141d18186eeae167218a1 (patch)
treed24ca9a920cd92247b2f52f6512a73c317e545fb
parent3e964432f56f05a8ef639902796e476456b230ad (diff)
[ALSA] fix some memory leaks
Modules: Generic drivers,ES18xx driver,CS46xx driver This patch fixes two memory leaks spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/drivers/serial-u16550.c1
-rw-r--r--sound/isa/es18xx.c1
-rw-r--r--sound/pci/cs46xx/dsp_spos.c10
3 files changed, 9 insertions, 3 deletions
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 13b46d12564a..1a7fbefe4740 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -789,6 +789,7 @@ static int __init snd_uart16550_create(struct snd_card *card,
789 789
790 if ((err = snd_uart16550_detect(uart)) <= 0) { 790 if ((err = snd_uart16550_detect(uart)) <= 0) {
791 printk(KERN_ERR "no UART detected at 0x%lx\n", iobase); 791 printk(KERN_ERR "no UART detected at 0x%lx\n", iobase);
792 snd_uart16550_free(uart);
792 return -ENODEV; 793 return -ENODEV;
793 } 794 }
794 795
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index bb709264216f..721955d26194 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -2083,6 +2083,7 @@ static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard,
2083 err = pnp_activate_dev(acard->devc); 2083 err = pnp_activate_dev(acard->devc);
2084 if (err < 0) { 2084 if (err < 0) {
2085 snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n"); 2085 snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n");
2086 kfree(cfg);
2086 return -EAGAIN; 2087 return -EAGAIN;
2087 } 2088 }
2088 snd_printdd("pnp: port=0x%lx\n", pnp_port_start(acard->devc, 0)); 2089 snd_printdd("pnp: port=0x%lx\n", pnp_port_start(acard->devc, 0));
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c
index 8726a68051e7..f407d2a5ce3b 100644
--- a/sound/pci/cs46xx/dsp_spos.c
+++ b/sound/pci/cs46xx/dsp_spos.c
@@ -237,7 +237,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
237 237
238 if (ins->symbol_table.symbols == NULL) { 238 if (ins->symbol_table.symbols == NULL) {
239 cs46xx_dsp_spos_destroy(chip); 239 cs46xx_dsp_spos_destroy(chip);
240 return NULL; 240 goto error;
241 } 241 }
242 242
243 ins->code.offset = 0; 243 ins->code.offset = 0;
@@ -246,7 +246,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
246 246
247 if (ins->code.data == NULL) { 247 if (ins->code.data == NULL) {
248 cs46xx_dsp_spos_destroy(chip); 248 cs46xx_dsp_spos_destroy(chip);
249 return NULL; 249 goto error;
250 } 250 }
251 251
252 ins->nscb = 0; 252 ins->nscb = 0;
@@ -257,7 +257,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
257 257
258 if (ins->modules == NULL) { 258 if (ins->modules == NULL) {
259 cs46xx_dsp_spos_destroy(chip); 259 cs46xx_dsp_spos_destroy(chip);
260 return NULL; 260 goto error;
261 } 261 }
262 262
263 /* default SPDIF input sample rate 263 /* default SPDIF input sample rate
@@ -280,6 +280,10 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
280 /* left and right validity bits */ (1 << 13) | (1 << 12); 280 /* left and right validity bits */ (1 << 13) | (1 << 12);
281 281
282 return ins; 282 return ins;
283
284error:
285 kfree(ins);
286 return NULL;
283} 287}
284 288
285void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip) 289void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)