diff options
| author | Kaushlendra Kumar <kaushlendra.kumar@intel.com> | 2025-10-30 08:02:28 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-12-12 18:40:20 +0100 |
| commit | d1e9dd53e68f12b123fb4cdd4e142b322287e272 (patch) | |
| tree | 8dca3c27d55686e308448677310c9c86a8e44644 /include/net/aligned_data.h | |
| parent | ae026645598bd419a52f4fc137032414b7c7ffe1 (diff) | |
ACPI: MRRM: Fix memory leaks and improve error handling
[ Upstream commit 4b93d211bbffd3dce76664d95f2306d23e7215ce ]
Add proper error handling and resource cleanup to prevent memory leaks
in add_boot_memory_ranges(). The function now checks for NULL return
from kobject_create_and_add(), uses local buffer for range names to
avoid dynamic allocation, and implements a cleanup path that removes
previously created sysfs groups and kobjects on failure.
This prevents resource leaks when kobject creation or sysfs group
creation fails during boot memory range initialization.
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Link: https://patch.msgid.link/20251030023228.3956296-1-kaushlendra.kumar@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/net/aligned_data.h')
0 files changed, 0 insertions, 0 deletions
