Re: [PATCH] device property: set fwnode->secondary to NULL in fwnode_init()
From: Andy Shevchenko
Date: Wed May 06 2026 - 09:14:33 EST
On Wed, May 06, 2026 at 01:57:00PM +0200, Bartosz Golaszewski wrote:
> If a firmware node is allocated on the stack (for instance: temporary
> software node whose life-time we control) or on the heap - but using a
> non-zeroing allocation function - and initialized using fwnode_init(),
> its secondary pointer will contain uninitalized memory which likely will
> be neither NULL nor IS_ERR() and so may end up being dereferenced (for
> example: in dev_to_swnode()). Set fwnode->secondary to NULL on
> initialization.
Hmm... Are you going to use that outside of fw_devlink?
The patch itself looks good to me, but I'm not sure I understand how it's
related to all the work you are doing WRT fwnode core implementation.
FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
But Saravana is the best person to actually tell if this patch makes sense.
--
With Best Regards,
Andy Shevchenko