]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda - Fix a memory leak bug
authorWenwen Wang <wenwen@cs.uga.edu>
Sat, 10 Aug 2019 04:29:48 +0000 (23:29 -0500)
committerTakashi Iwai <tiwai@suse.de>
Sat, 10 Aug 2019 07:57:22 +0000 (09:57 +0200)
commita8956eae3a64802d953f6df5786d565d718f88b3
tree4c9319fe3f08a3ec3846a4b331f635481f6d1d0c
parentf977f3d76f704dd5d2e280f6147b553fd17de714
ALSA: hda - Fix a memory leak bug

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: 93b7cf369ebf ("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>
sound/pci/hda/hda_generic.c