ALSA: hda - Fix memory leaks at error path in patch_cirrus.c
[pandora-kernel.git] / sound / pci / hda / patch_cirrus.c
index ec0518e..e449278 100644 (file)
@@ -1404,7 +1404,7 @@ static int patch_cs420x(struct hda_codec *codec)
        return 0;
 
  error:
-       kfree(codec->spec);
+       cs_free(codec);
        codec->spec = NULL;
        return err;
 }
@@ -1949,7 +1949,7 @@ static int patch_cs421x(struct hda_codec *codec)
        return 0;
 
  error:
-       kfree(codec->spec);
+       cs_free(codec);
        codec->spec = NULL;
        return err;
 }