Skip to content

Commit

Permalink
ALSA: hda - Fix memory leaks at error path in patch_cirrus.c
Browse files Browse the repository at this point in the history
The proper destructor should be called at the error path.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Oct 10, 2012
1 parent 7819d1c commit c5e0b6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit c5e0b6d

Please sign in to comment.