Skip to content

Commit 6fa6586

Browse files
wenwenwang1Zile995
authored andcommitted
ALSA: hda - Fix a memory leak bug
commit cfef67f upstream. In snd_hda_parse_generic_codec(), 'spec' is allocated through kzalloc(). Then, the pin widgets in 'codec' are parsed. However, if the parsing process fails, 'spec' is not deallocated, leading to a memory leak. To fix the above issue, free 'spec' before returning the error. Fixes: 352f7f9 ("ALSA: hda - Merge Realtek parser code to generic parser") Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I19576a1c256fe1b361581e755153706737a41011
1 parent 496052c commit 6fa6586

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/pci/hda/hda_generic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5474,7 +5474,7 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec)
54745474

54755475
err = snd_hda_parse_pin_defcfg(codec, &spec->autocfg, NULL, 0);
54765476
if (err < 0)
5477-
return err;
5477+
goto error;
54785478

54795479
err = snd_hda_gen_parse_auto_config(codec, &spec->autocfg);
54805480
if (err < 0)

0 commit comments

Comments
 (0)