All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Hodges <git@danielhodges.dev>
To: "Prasanth Ksr" <prasanth.ksr@dell.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Mario Limonciello <mario.limonciello@dell.com>,
	Divya Bharathi <divya.bharathi@dell.com>,
	Dell.Client.Kernel@dell.com, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Daniel Hodges <git@danielhodges.dev>,
	stable@vger.kernel.org
Subject: [PATCH] platform/x86: dell-wmi-sysman: fix kobject leak on populate failure
Date: Fri,  6 Feb 2026 18:16:42 -0500	[thread overview]
Message-ID: <20260206231642.30051-1-git@danielhodges.dev> (raw)

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@vger.kernel.org
Signed-off-by: Daniel Hodges <git@danielhodges.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


             reply	other threads:[~2026-02-06 23:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 23:16 Daniel Hodges [this message]
2026-02-07  7:48 ` [PATCH] platform/x86: dell-wmi-sysman: fix kobject leak on populate failure Greg KH
2026-02-07 16:52   ` Daniel Hodges
2026-02-08  6:31     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260206231642.30051-1-git@danielhodges.dev \
    --to=git@danielhodges.dev \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=divya.bharathi@dell.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@dell.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=prasanth.ksr@dell.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.