]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ALSA] fix some memory leaks
authorAdrian Bunk <bunk@stusta.de>
Tue, 14 Mar 2006 08:44:19 +0000 (09:44 +0100)
committerJaroslav Kysela <perex@suse.cz>
Wed, 22 Mar 2006 09:38:23 +0000 (10:38 +0100)
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>
sound/drivers/serial-u16550.c
sound/isa/es18xx.c
sound/pci/cs46xx/dsp_spos.c

index 13b46d12564aae174a025f76b665c3e0b543946f..1a7fbefe4740de3e013a262fbbf34e85956c76fd 100644 (file)
@@ -789,6 +789,7 @@ static int __init snd_uart16550_create(struct snd_card *card,
 
        if ((err = snd_uart16550_detect(uart)) <= 0) {
                printk(KERN_ERR "no UART detected at 0x%lx\n", iobase);
+               snd_uart16550_free(uart);
                return -ENODEV;
        }
 
index bb709264216f9139448bf0e683ed1796c598d937..721955d26194b25607c012cbe21d3ba4bb9898b6 100644 (file)
@@ -2083,6 +2083,7 @@ static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard,
        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));
index 8726a68051e793d8013bd29b4b478dafc8d87e4b..f407d2a5ce3b6a37a1f0f99d26b04cc99985c1ec 100644 (file)
@@ -237,7 +237,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
 
        if (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_spos_create (struct snd_cs46xx * chip)
 
        if (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_spos_create (struct snd_cs46xx * chip)
 
        if (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_spos_create (struct snd_cs46xx * chip)
         /* 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)