summaryrefslogtreecommitdiff
path: root/rust/macros/zeroable.rs
diff options
context:
space:
mode:
authorKaushlendra Kumar <kaushlendra.kumar@intel.com>2025-10-30 08:02:28 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-11-07 21:48:49 +0100
commit4b93d211bbffd3dce76664d95f2306d23e7215ce (patch)
tree1fec793e6d6d1106604671baf41121a8370bc458 /rust/macros/zeroable.rs
parent6146a0f1dfae5d37442a9ddcba012add260bceb0 (diff)
ACPI: MRRM: Fix memory leaks and improve error handling
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>
Diffstat (limited to 'rust/macros/zeroable.rs')
0 files changed, 0 insertions, 0 deletions