From: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
To: Manivannan Sadhasivam <mani@kernel.org>,
Jassi Brar <jassisinghbrar@gmail.com>,
Huang Yiwei <quic_hyiwei@quicinc.com>,
Sudeep Holla <sudeep.holla@kernel.org>
Cc: Jassi Brar <jaswinder.singh@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>,
Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Subject: [PATCH v2 1/2] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure
Date: Tue, 06 Oct 2026 16:29:13 +0530 [thread overview]
Message-ID: <20261006-b4-mbox_double_unregister_fix-v2-1-cd5739b60718@oss.qualcomm.com> (raw)
In-Reply-To: <20261006-b4-mbox_double_unregister_fix-v2-0-cd5739b60718@oss.qualcomm.com>
qcom_ipcc_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_irq() subsequently fails, the
err_req_irq: label 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: e9d50e4b4d04 ("mailbox: qcom-ipcc: Dynamic alloc for channel arrangement")
Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
---
drivers/mailbox/qcom-ipcc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
index 185b63f724d4..b301cefe4954 100644
--- a/drivers/mailbox/qcom-ipcc.c
+++ b/drivers/mailbox/qcom-ipcc.c
@@ -329,15 +329,12 @@ static int qcom_ipcc_probe(struct platform_device *pdev)
IRQF_TRIGGER_HIGH | IRQF_NO_SUSPEND |
IRQF_NO_THREAD, name, ipcc);
if (ret < 0)
- goto err_req_irq;
+ goto err_mbox;
platform_set_drvdata(pdev, ipcc);
return 0;
-err_req_irq:
- if (ipcc->num_chans)
- mbox_controller_unregister(&ipcc->mbox);
err_mbox:
irq_domain_remove(ipcc->irq_domain);
--
2.43.0
next prev parent reply other threads:[~2026-10-06 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 10:59 [PATCH v2 0/2] mailbox: " Anup Vishwakarma
2026-10-06 10:59 ` Anup Vishwakarma [this message]
2026-10-06 10:59 ` [PATCH v2 2/2] mailbox: arm_mhu_db: " Anup Vishwakarma
2026-10-12 1:32 ` [PATCH v2 0/2] mailbox: " Jassi Brar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261006-b4-mbox_double_unregister_fix-v2-1-cd5739b60718@oss.qualcomm.com \
--to=anup.vishwakarma@oss.qualcomm.com \
--cc=jassisinghbrar@gmail.com \
--cc=jaswinder.singh@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mukesh.ojha@oss.qualcomm.com \
--cc=quic_hyiwei@quicinc.com \
--cc=sudeep.holla@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®