diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-09-04 11:38:36 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-09-04 11:42:27 -0400 |
commit | cc91ceaf3efd9a2364463b5f85d9f391f1ddaa9d (patch) | |
tree | 41cfda3d5a464f76dae22ad2d57d4a09924fdf87 | |
parent | 284b4c9289766c6294d4c6292aea565f78215b0e (diff) |
ALSA: hda/ca0132 - Fix memory leak at error path
The CA0132 codec driver doesn't call the free function at its error
path of the probe, which leaves the allocated memory. Call
ca0132_free() properly at the error handling.
Fixes: a73d511c4867 ("ALSA: hda/ca0132: Add unsol handler for DSP and jack detection")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_ca0132.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index a148176c16a9..3e73d5c6ccfc 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c | |||
@@ -4774,13 +4774,17 @@ static int patch_ca0132(struct hda_codec *codec) | |||
4774 | 4774 | ||
4775 | err = ca0132_prepare_verbs(codec); | 4775 | err = ca0132_prepare_verbs(codec); |
4776 | if (err < 0) | 4776 | if (err < 0) |
4777 | return err; | 4777 | goto error; |
4778 | 4778 | ||
4779 | err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); | 4779 | err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); |
4780 | if (err < 0) | 4780 | if (err < 0) |
4781 | return err; | 4781 | goto error; |
4782 | 4782 | ||
4783 | return 0; | 4783 | return 0; |
4784 | |||
4785 | error: | ||
4786 | ca0132_free(codec); | ||
4787 | return err; | ||
4784 | } | 4788 | } |
4785 | 4789 | ||
4786 | /* | 4790 | /* |