Skip to content

Commit cc91cea

Browse files
committed
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: a73d511 ("ALSA: hda/ca0132: Add unsol handler for DSP and jack detection") Signed-off-by: Takashi Iwai <[email protected]>
1 parent 284b4c9 commit cc91cea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sound/pci/hda/patch_ca0132.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4774,13 +4774,17 @@ static int patch_ca0132(struct hda_codec *codec)
47744774

47754775
err = ca0132_prepare_verbs(codec);
47764776
if (err < 0)
4777-
return err;
4777+
goto error;
47784778

47794779
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL);
47804780
if (err < 0)
4781-
return err;
4781+
goto error;
47824782

47834783
return 0;
4784+
4785+
error:
4786+
ca0132_free(codec);
4787+
return err;
47844788
}
47854789

47864790
/*

0 commit comments

Comments
 (0)