Re: [PATCH 05/28] mfd: bd96801: Allocate watchdog IRQ resource on the heap

From: Matti Vaittinen

Date: Mon Oct 26 2026 - 02:56:20 EST


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?

Other than that,
Reviewed-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>

Thanks for fixing this!

Yours,
-- Matti

--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~