Re: [PATCH 05/28] mfd: bd96801: Allocate watchdog IRQ resource on the heap
From: Lee Jones
Date: Mon Oct 26 2026 - 08:46:49 EST
On Mon, 26 Oct 2026, Matti Vaittinen wrote:
> On 21/10/2026 15:09, Lee Jones wrote:
> > bd96801_i2c_probe() declares struct resource wdg_irq on the stack and
> > assigns its address to ddata->cells[WDG_CELL].resources. Although
> > mfd_add_device() deep-copies the resource table via
> > platform_device_add_resources() before bd96801_i2c_probe() returns, the
> > shared cell template and the shallow MFD cell copy attached to the child
> > platform device retain a stale pointer to the expired stack frame.
> >
> > Allocate wdg_irq on the heap via devm_kzalloc() alongside regulator_res
> > so the stored pointer remains valid for the lifetime of the device.
> >
> > Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
>
> Does this warrant a fixes-tag?
Not sure why this one doesn't have one.
I'll look into it and apply one if appropriate, thanks.
--
Lee Jones