Skip to contentSkip to conversation

ACPI / device_sysfs: Use ACPI_FREE for ACPI object deallocation

PATCH Applied Kaushlendra Kumar 2 participants 2 messages Aug 22, 2025 – Aug 25, 2025 ACPI

lore
Share & tools
lore
#0 lore raw

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
index 3961fc47152c..cd199fbe4dc9 100644
@@ -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
maintainer Applied
#1 lore raw
Quoted 19 lines · Kaushlendra Kumar

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 +0 -0
index 3961fc47152c..cd199fbe4dc9 100644

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!