From: Takashi Iwai Date: Wed, 10 Oct 2012 06:50:35 +0000 (+0200) Subject: ALSA: hda - Fix memory leaks at error path in patch_cirrus.c X-Git-Tag: upstream/snapshot3+hdmi~6461^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5e0b6dbad9b4d18c561af90b384d02373f1c994;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ALSA: hda - Fix memory leaks at error path in patch_cirrus.c The proper destructor should be called at the error path. Cc: Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index fc92819..f441f53 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c @@ -1444,7 +1444,7 @@ static int patch_cs420x(struct hda_codec *codec) return 0; error: - kfree(codec->spec); + cs_free(codec); codec->spec = NULL; return err; } @@ -1989,7 +1989,7 @@ static int patch_cs4210(struct hda_codec *codec) return 0; error: - kfree(codec->spec); + cs_free(codec); codec->spec = NULL; return err; } @@ -2014,7 +2014,7 @@ static int patch_cs4213(struct hda_codec *codec) return 0; error: - kfree(codec->spec); + cs_free(codec); codec->spec = NULL; return err; }