Commit e2cde312 authored by Adrian Bunk's avatar Adrian Bunk

[ALSA] fix some memory leaks

This patch fixes two memory leaks spotted by the Coverity checker.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 2b126698
...@@ -1927,6 +1927,7 @@ static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard, ...@@ -1927,6 +1927,7 @@ static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard,
err = pnp_activate_dev(acard->devc); err = pnp_activate_dev(acard->devc);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n"); snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n");
kfree(cfg);
return -EAGAIN; return -EAGAIN;
} }
snd_printdd("pnp: port=0x%lx\n", pnp_port_start(acard->devc, 0)); snd_printdd("pnp: port=0x%lx\n", pnp_port_start(acard->devc, 0));
......
...@@ -235,7 +235,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) ...@@ -235,7 +235,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
if (ins->symbol_table.symbols == NULL) { if (ins->symbol_table.symbols == NULL) {
cs46xx_dsp_spos_destroy(chip); cs46xx_dsp_spos_destroy(chip);
return NULL; goto error;
} }
ins->code.offset = 0; ins->code.offset = 0;
...@@ -244,7 +244,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) ...@@ -244,7 +244,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
if (ins->code.data == NULL) { if (ins->code.data == NULL) {
cs46xx_dsp_spos_destroy(chip); cs46xx_dsp_spos_destroy(chip);
return NULL; goto error;
} }
ins->nscb = 0; ins->nscb = 0;
...@@ -255,7 +255,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) ...@@ -255,7 +255,7 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
if (ins->modules == NULL) { if (ins->modules == NULL) {
cs46xx_dsp_spos_destroy(chip); cs46xx_dsp_spos_destroy(chip);
return NULL; goto error;
} }
/* default SPDIF input sample rate /* default SPDIF input sample rate
...@@ -278,6 +278,10 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) ...@@ -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); /* left and right validity bits */ (1 << 13) | (1 << 12);
return ins; return ins;
error:
kfree(ins);
return NULL;
} }
void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip) void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment