On Thu, Dec 3, 2026 at 5:28 PM Lee Jones [off-list ref] wrote:
sun6i_msgbox_probe() requests the interrupt using devm_request_irq()
before initialising mbox->controller and mbox->lock, while
sun6i_msgbox_remove() manually calls mbox_controller_unregister() and
clk_disable_unprepare() before devres frees the IRQ. An interrupt
arriving during probe failure or device removal can access unclocked
MMIO registers or freed controller data in sun6i_msgbox_irq().
Retrieve the IRQ via platform_get_irq() and register it with
request_irq() after initialising mbox->controller and mbox->lock, then
explicitly call free_irq() before disabling the clock in both the probe
error path and sun6i_msgbox_remove().
Fixes: 25831c44b0b7 ("mailbox: sun6i-msgbox: Add a new mailbox driver")
Closes: https://sashiko.dev/#/bug/linux-b10c9846-995f-40c3-a18c-97b9cb0d0611
Cc: <redacted>
Signed-off-by: Lee Jones <lee@kernel.org>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>