Commit 311a597e authored by Takashi Iwai's avatar Takashi Iwai Committed by Ben Hutchings

ALSA: hda - Fix memory leaks at error path in patch_cirrus.c

commit c5e0b6db upstream.

The proper destructor should be called at the error path.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
[bwh: Backported to 3.2: drop the change to nonexistent patch_cs4213()]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 814a7833
...@@ -1404,7 +1404,7 @@ static int patch_cs420x(struct hda_codec *codec) ...@@ -1404,7 +1404,7 @@ static int patch_cs420x(struct hda_codec *codec)
return 0; return 0;
error: error:
kfree(codec->spec); cs_free(codec);
codec->spec = NULL; codec->spec = NULL;
return err; return err;
} }
...@@ -1949,7 +1949,7 @@ static int patch_cs421x(struct hda_codec *codec) ...@@ -1949,7 +1949,7 @@ static int patch_cs421x(struct hda_codec *codec)
return 0; return 0;
error: error:
kfree(codec->spec); cs_free(codec);
codec->spec = NULL; codec->spec = NULL;
return err; return err;
} }
......
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