]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86/intel/pmt: Fix kobject memory leak on init failure
authorKaushlendra Kumar <kaushlendra.kumar@intel.com>
Tue, 23 Dec 2025 08:40:41 +0000 (14:10 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:16:46 +0000 (10:16 +0100)
commit277b256f579ae8966bc3eeb27bbfc6de7ad17010
tree74e3a4d7648687e2ba7e297a1fa7ff5fdd693b6d
parent66299520bb6e88caf4638104b65a8b4248ca64a8
platform/x86/intel/pmt: Fix kobject memory leak on init failure

[ Upstream commit 00c22b1e84288bf0e17ab1e7e59d75237cf0d0dc ]

When kobject_init_and_add() fails in pmt_features_discovery(), the
function returns without calling kobject_put(). This violates the
kobject API contract where kobject_put() must be called even on
initialization failure to properly release allocated resources.

Fixes: d9a078809356 ("platform/x86/intel/pmt: Add PMT Discovery driver")
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Link: https://patch.msgid.link/20251223084041.3832933-1-kaushlendra.kumar@intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/intel/pmt/discovery.c