RE: [PATCH net] platform/x86: intel_pmc_ipc: fix ACPI buffer memory leak

From
Liu, Yongxin <hidden>
Date
2025-11-25 01:26:11
Also in
lkml, platform-driver-x86, stable
Reply to
Andrew Lunn, 2025-11-25
-----Original Message-----
From: Andrew Lunn <andrew@lunn.ch>
Sent: Tuesday, November 25, 2025 8:30
To: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: Liu, Yongxin <redacted>; LKML <linux-
kernel@vger.kernel.org>; Netdev [off-list ref];
david.e.box@linux.intel.com; chao.qin@intel.com;
yong.liang.choong@linux.intel.com; kuba@kernel.org; platform-driver-
x86@vger.kernel.org; stable@vger.kernel.org
Subject: Re: [PATCH net] platform/x86: intel_pmc_ipc: fix ACPI buffer
memory leak

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and
know the content is safe.
quoted
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
Thank you Ilpo and Andrew for your valuable review.
I will send a V2 to cover all possible paths.


Thanks,
Yongxin
---
pw-bot: cr
Thread (4 messages) 4 messages, 3 authors, last reply 2025-11-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help