[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260206231642.30051-1-git@danielhodges.dev>
Date: Fri, 6 Feb 2026 18:16:42 -0500
From: Daniel Hodges <git@...ielhodges.dev>
To: Prasanth Ksr <prasanth.ksr@...l.com>,
Hans de Goede <hansg@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Mario Limonciello <mario.limonciello@...l.com>,
Divya Bharathi <divya.bharathi@...l.com>,
Dell.Client.Kernel@...l.com,
platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org,
Daniel Hodges <git@...ielhodges.dev>,
stable@...r.kernel.org
Subject: [PATCH] platform/x86: dell-wmi-sysman: fix kobject leak on populate failure
When populate_enum_data(), populate_int_data(), populate_str_data(),
or populate_po_data() fails after a successful kobject_init_and_add(),
the code jumps to err_attr_init without calling kobject_put() on
attr_name_kobj, leaking the kobject and its associated memory.
Add the missing kobject_put() call before the goto to properly release
the kobject on error.
Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
Cc: stable@...r.kernel.org
Signed-off-by: Daniel Hodges <git@...ielhodges.dev>
---
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
index f5402b714657..d9f6d24c84d6 100644
--- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
+++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
@@ -497,6 +497,7 @@ static int init_bios_attributes(int attr_type, const char *guid)
if (retval) {
pr_debug("failed to populate %s\n",
elements[ATTR_NAME].string.pointer);
+ kobject_put(attr_name_kobj);
goto err_attr_init;
}
--
2.52.0
Powered by blists - more mailing lists