Commit cc91ceaf authored by Takashi Iwai's avatar Takashi Iwai

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: a73d511c ("ALSA: hda/ca0132: Add unsol handler for DSP and jack detection")
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 284b4c92
...@@ -4774,13 +4774,17 @@ static int patch_ca0132(struct hda_codec *codec) ...@@ -4774,13 +4774,17 @@ static int patch_ca0132(struct hda_codec *codec)
err = ca0132_prepare_verbs(codec); err = ca0132_prepare_verbs(codec);
if (err < 0) if (err < 0)
return err; goto error;
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL);
if (err < 0) if (err < 0)
return err; goto error;
return 0; return 0;
error:
ca0132_free(codec);
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