# Re: \[PATCH net\] platform/x86: intel\_pmc\_ipc: fix ACPI buffer memory leak

- From: Andrew Lunn \<andrew@lunn.ch\>
- Date: 2025-11-25 00:29:43 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/11/3311219
- Thread: https://ratatoskr.run/netdev/2025/11/3309837/t.md

```text
> Good catch but this fix doesn't address all possible paths. So please use 
> cleanup.h instead:
> 
> 	union acpi_object *obj __free(kfree) = buffer.pointer;
> 
> And don't forget to add the #include.

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

  1.6.5. Using device-managed and cleanup.h constructs¶

  Low level cleanup constructs (such as __free()) can be used when
  building APIs and helpers, especially scoped iterators. However,
  direct use of __free() within networking core and drivers is
  discouraged. Similar guidance applies to declaring variables
  mid-function.

    Andrew

---
pw-bot: cr
```
