ACPI / device_sysfs: Use ACPI_FREE for ACPI object deallocation
PATCH 1/1 ACPI / device_sysfs: Use ACPI_FREE for ACPI object deallocation
Replace kfree() with ACPI_FREE() for deallocating ACPI objects in the description_show() function.
The str_obj variable contains an ACPI object that was allocated through ACPI subsystem functions. Such objects should be freed using ACPI_FREE() rather than the generic kfree() to ensure proper cleanup and maintain consistency with ACPI memory management conventions.
--- drivers/acpi/device_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/device_sysfs.c +1 -1
@@ -464,7 +464,7 @@ static ssize_t description_show(struct device *dev, buf[result++] ='\n' ; -kfree (str_obj); +ACPI_FREE (str_obj);return result; }
Signature · 1 line
2.34.1
Quoted 19 lines · Kaushlendra Kumar
Replace
kfree()withACPI_FREE()for deallocating ACPI objects in thedescription_show()function.The
str_objvariable contains an ACPI object that was allocated through ACPI subsystem functions. Such objects should be freed usingACPI_FREE()rather than the generickfree()to ensure proper cleanup and maintain consistency with ACPI memory management conventions.Signed-off-by Kaushlendra Kumar <[email protected]>--- drivers/acpi/device_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/device_sysfs.c +0
-0
drivers/acpi/device_sysfs.c static ssize_t description_show(struct device *dev,
Quoted 9 lines
drivers/acpi/device_sysfs.c +1
-2@@ -464,7 +464,7 @@ static ssize_t description_show(struct device *dev, buf[result++] ='\n' ; -kfree (str_obj); +ACPI_FREE (str_obj);return result; } --
Applied as 6.18 material under a modified subject and with a new changelog.
Thanks!