]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: proc: Avoid possible leaks of snd_info_entry objects
authorTakashi Iwai <tiwai@suse.de>
Wed, 23 Jan 2019 16:59:40 +0000 (17:59 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 24 Jan 2019 13:40:26 +0000 (14:40 +0100)
commita475d12cc9fab7fb1e0aedf1cf65e586f0e7ecb0
treed47977876513a4e0c71ca6a07d1d7de99093c9b7
parent8f660543dfedec26f7bfc435476bebea43b807f4
ALSA: proc: Avoid possible leaks of snd_info_entry objects

This patch changes the parent pointer assignment of snd_info_entry
object to be always non-NULL.  More specifically,check the parent
argument in snd_info_create_module_entry() & co, and assign
snd_proc_root if NULL is passed there.

This assures that the proc object is always freed when the root is
freed, so avoid possible memory leaks.  For example, some error paths
(e.g. snd_info_register() error at snd_minor_info_init()) may leave
snd_info_entry object although the proc file itself is freed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/info.c