Re: [PATCH v2 3/5] ACPI: Support __free() from cleanup.h for ACPI objects
"Rafael J. Wysocki (Intel)" <[email protected]>
| Newsgroups | org.kernel.vger.linux-acpi,org.kernel.vger.linux-media,org.kernel.vger.platform-driver-x86 |
|---|---|
| Message-ID | <CAJZ5v0ieb2FcANOt0MRMsTrwtbLiUF48W_c=3z3OpNH92d=7vg@mail.gmail.com> |
On Mon, Aug 24, 2026 at 11:13 PM Sakari Ailus <[email protected]> wrote: > > Use DEFINE_FREE() to allow ACPI objects to be released automatically. But at least some of them are allocated by ACPICA functions like acpi_evaluate_object() and so they have no proper constructors. > Signed-off-by: Sakari Ailus <[email protected]> > --- > include/linux/acpi.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index 10d6c6c11bdf..c89390ac6287 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -62,6 +62,8 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev) > #define ACPI_HANDLE_FWNODE(fwnode) \ > acpi_device_handle(to_acpi_device_node(fwnode)) > > +DEFINE_FREE(ACPI_FREE, void *, ACPI_FREE(_T)) > + > static inline struct fwnode_handle *acpi_alloc_fwnode_static(void) > { > struct fwnode_handle *fwnode; > --