]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Fix memory leaks at error path in patch_cirrus.c
authorTakashi Iwai <tiwai@suse.de>
Wed, 10 Oct 2012 06:50:35 +0000 (08:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Oct 2012 16:27:57 +0000 (09:27 -0700)
commit c5e0b6dbad9b4d18c561af90b384d02373f1c994 upstream.

The proper destructor should be called at the error path.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/patch_cirrus.c

index c83ccdba1e5afc1dca9715a870eedf68a8961ee8..2bc6c51f58e7939c74f18368925cee98f0f7da53 100644 (file)
@@ -1427,7 +1427,7 @@ static int patch_cs420x(struct hda_codec *codec)
        return 0;
 
  error:
-       kfree(codec->spec);
+       cs_free(codec);
        codec->spec = NULL;
        return err;
 }
@@ -1984,7 +1984,7 @@ static int patch_cs4210(struct hda_codec *codec)
        return 0;
 
  error:
-       kfree(codec->spec);
+       cs_free(codec);
        codec->spec = NULL;
        return err;
 }
@@ -2009,7 +2009,7 @@ static int patch_cs4213(struct hda_codec *codec)
        return 0;
 
  error:
-       kfree(codec->spec);
+       cs_free(codec);
        codec->spec = NULL;
        return err;
 }