]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: dell-sysman: Fix reference leak
authorArmin Wolf <W_Armin@gmx.de>
Sat, 5 Aug 2023 05:36:10 +0000 (07:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:54 +0000 (09:42 +0200)
commit6ced15ff1746006476f1407fe722911a45a7874d
treefa722480f1dd4a13daf57a8e7bf8e0a1754db102
parent45e3181d7995f66057bb0627f6c2994111bb86a1
platform/x86: dell-sysman: Fix reference leak

[ Upstream commit 7295a996fdab7bf83dc3d4078fa8b139b8e0a1bf ]

If a duplicate attribute is found using kset_find_obj(),
a reference to that attribute is returned. This means
that we need to dispose it accordingly. Use kobject_put()
to dispose the duplicate attribute in such a case.

Compile-tested only.

Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230805053610.7106-1-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c