]> git.ipfire.org Git - thirdparty/kernel/stable.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>
Tue, 19 Sep 2023 10:22:46 +0000 (12:22 +0200)
commitd079a3e1ccdd183b75db4f5289be347980b45284
treec5a4078fd25917d681746f1207719201c6ce6da4
parent426bd7418701263dd44461bd525392ad2a184490
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