From 8228ed61b6cbd6e79531c9ebfcad233c35eae562 Mon Sep 17 00:00:00 2001 From: Anup Vishwakarma Date: Tue, 6 Oct 2026 16:29:14 +0530 Subject: [PATCH] mailbox: arm_mhu_db: Remove redundant mbox_controller_unregister() on probe failure mhu_db_probe() registers the mailbox controller via devm_mbox_controller_register(), which automatically calls mbox_controller_unregister() through devres when the device is removed or probe fails. If devm_request_threaded_irq() subsequently fails in the channel setup loop, the error path also manually calls mbox_controller_unregister(), resulting in a double call that corrupts the global mailbox controller list and causes a kernel panic. Remove the redundant manual call and rely on devres for cleanup. Fixes: 7002ca237b21 ("mailbox: arm_mhu: Add ARM MHU doorbell driver") Signed-off-by: Anup Vishwakarma Reviewed-by: Mukesh Ojha Signed-off-by: Jassi Brar --- drivers/mailbox/arm_mhu_db.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mailbox/arm_mhu_db.c b/drivers/mailbox/arm_mhu_db.c index a39239e38a47..9f1c7bcfdcb4 100644 --- a/drivers/mailbox/arm_mhu_db.c +++ b/drivers/mailbox/arm_mhu_db.c @@ -317,10 +317,8 @@ static int mhu_db_probe(struct amba_device *adev, const struct amba_id *id) err = devm_request_threaded_irq(dev, irq, NULL, mhu_db_mbox_rx_handler, IRQF_ONESHOT, "mhu_db_link", mhu); - if (err) { - mbox_controller_unregister(&mhu->mbox); + if (err) return err; - } } dev_info(dev, "ARM MHU Doorbell mailbox registered\n");