Skip to contentSkip to conversation

ACPI / DPTF: Use ACPI_FREE() for ACPI buffer deallocation

PATCH Superseded Kaushlendra Kumar 2 participants 3 messages Oct 6, 2025 – Oct 28, 2025 ACPI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / DPTF: Use ACPI_FREE() for ACPI buffer deallocation

Replace kfree() with ACPI_FREE() in pch_fivr_read() for deallocating ACPI buffer objects. The buffer.pointer contains an ACPI object allocated through ACPI subsystem functions and should be freed using ACPI_FREE() to ensure proper cleanup and maintain consistency with ACPI memory management conventions.

---
 drivers/acpi/dptf/dptf_pch_fivr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/dptf/dptf_pch_fivr.c +1 -1
index 952216c67d58..8d7e555929d3 100644
@@ -41,7 +41,7 @@ static int pch_fivr_read(acpi_handle handle, char *method, struct pch_fivr_resp
 	ret = 0;
 
 release_buffer:
-	kfree(buffer.pointer);
+	ACPI_FREE(buffer.pointer);
 	return ret;
 }
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · Kaushlendra Kumar

Replace kfree() with ACPI_FREE() in pch_fivr_read() for deallocating ACPI buffer objects. The buffer.pointer contains an ACPI object allocated through ACPI subsystem functions and should be freed using ACPI_FREE() to ensure proper cleanup and maintain consistency with ACPI memory management conventions.

This is just a conventional thing because ACPI_FREE() in Linux is implemented as kfree().

There is no correctness issue here, just the convention is not followed, so please update the changelog.

Quoted 21 lines
---
 drivers/acpi/dptf/dptf_pch_fivr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/dptf/dptf_pch_fivr.c +1 -2
index 952216c67d58..8d7e555929d3 100644
@@ -41,7 +41,7 @@ static int pch_fivr_read(acpi_handle handle, char *method, struct pch_fivr_resp
        ret = 0;
 
 release_buffer:
-       kfree(buffer.pointer);
+       ACPI_FREE(buffer.pointer);
        return ret;
 }
 
--

2.34.1

#2 lore raw
Quoted 3 lines

This is just a conventional thing because ACPI_FREE() in Linux is implemented as kfree().

There is no correctness issue here, just the convention is not followed, so please update the changelog.

You're right. I have update the changelog in V2 patch to clarify this is about following ACPI coding conventions rather than fixing a functional issue.

Thanks for the feedback!

Kaushlendra