]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: hda: fix potential memleak in 'add_widget_node'
authorYe Bin <yebin10@huawei.com>
Thu, 10 Nov 2022 14:45:39 +0000 (22:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:57:15 +0000 (09:57 +0100)
commit3a79f9568de08657fcdbc41d6fc4c0ca145a7a2b
treea717dbd2089d34fc9d08c62ee08d0ef1f67584ae
parent380d64168da41b17dc4faaf5c5e780793566ca09
ALSA: hda: fix potential memleak in 'add_widget_node'

commit 9a5523f72bd2b0d66eef3d58810c6eb7b5ffc143 upstream.

As 'kobject_add' may allocated memory for 'kobject->name' when return error.
And in this function, if call 'kobject_add' failed didn't free kobject.
So call 'kobject_put' to recycling resources.

Signed-off-by: Ye Bin <yebin10@huawei.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221110144539.2989354-1-yebin@huaweicloud.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/hda/hdac_sysfs.c