Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[sfrench/cifs-2.6.git] / sound / pci / cs46xx / dsp_spos.c
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)