Re: [PATCH 2/4] software node: allow passing reference args to PROPERTY_ENTRY_REF
From: Andy Shevchenko
Date: Tue Mar 24 2026 - 08:36:24 EST
On Mon, Mar 23, 2026 at 05:39:38PM -0700, Dmitry Torokhov wrote:
> When dynamically creating software nodes and properties for subsequent
> use with software_node_register() current implementation of
> PROPERTY_ENTRY_REF is not suitable because it creates a temporary
> instance of struct software_node_ref_args on stack which will later
> disappear, and software_node_register() only does shallow copy of
> properties.
Isn't that the problem and we should take into account how to dup the reference
inside property core?
> Fix this by allowing to pass address of reference arguments structure
> directly into PROPERTY_ENTRY_REF(), so that caller can manage lifetime
> of the object properly.
--
With Best Regards,
Andy Shevchenko