summaryrefslogtreecommitdiffstats
path: root/sound/pci/cs46xx
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-03-14 09:44:19 +0100
committerJaroslav Kysela <perex@suse.cz>2006-03-22 10:38:23 +0100
commit202728d783a0fc180e7141d18186eeae167218a1 (patch)
treed24ca9a920cd92247b2f52f6512a73c317e545fb /sound/pci/cs46xx
parent[ALSA] usb-audio: add error message about missing split iso support (diff)
downloadlinux-202728d783a0fc180e7141d18186eeae167218a1.tar.xz
linux-202728d783a0fc180e7141d18186eeae167218a1.zip
[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>
Diffstat (limited to 'sound/pci/cs46xx')
-rw-r--r--sound/pci/cs46xx/dsp_spos.c10
1 files changed, 7 insertions, 3 deletions
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)
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)