diff options
author | Adrian Bunk <bunk@stusta.de> | 2006-12-15 00:25:52 +0100 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2006-12-15 00:25:52 +0100 |
commit | e2cde31279a1e6c0d3b6dbb9a8987c3c017ba4c6 (patch) | |
tree | cb1c0c851e3903efe768900ad8275abacb311142 /sound/pci | |
parent | 2b12669873c4e2a5b2f9d4ccc84653832b06c2ff (diff) |
[ALSA] fix some memory leaks
This patch fixes two memory leaks spotted by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/cs46xx/dsp_spos.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 445a448949e..81bcae073bc 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c @@ -235,7 +235,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; @@ -244,7 +244,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; @@ -255,7 +255,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 @@ -278,6 +278,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) |