mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
To: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Huang Yiwei <quic_hyiwei@quicinc.com>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure
Date: Tue, 6 Oct 2026 15:05:33 +0530	[thread overview]
Message-ID: <20261006093533.vbaihilgcbxonefv@hu-mojha-hyd.qualcomm.com> (raw)
In-Reply-To: <20261006-b4-mbox_double_unregister_fix-v1-1-9011ca208d36@oss.qualcomm.com>

On Tue, Oct 06, 2026 at 02:44:14PM +0530, Anup Vishwakarma wrote:
> 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>
> ---
>  drivers/mailbox/qcom-ipcc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
> index 185b63f724d4..206ad4884987 100644
> --- a/drivers/mailbox/qcom-ipcc.c
> +++ b/drivers/mailbox/qcom-ipcc.c
> @@ -336,8 +336,6 @@ static int qcom_ipcc_probe(struct platform_device *pdev)
>  	return 0;
>  
>  err_req_irq:

Get rid of label as well..

> -	if (ipcc->num_chans)
> -		mbox_controller_unregister(&ipcc->mbox);
>  err_mbox:
>  	irq_domain_remove(ipcc->irq_domain);
>  
> 

with the above fix..

Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>

-- 
-Mukesh Ojha

  reply	other threads:[~2026-10-06  9:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06  9:14 [PATCH 0/2] mailbox: " Anup Vishwakarma
2026-10-06  9:14 ` [PATCH 1/2] mailbox: qcom-ipcc: " Anup Vishwakarma
2026-10-06  9:35   ` Mukesh Ojha [this message]
2026-10-06  9:14 ` [PATCH 2/2] mailbox: arm_mhu_db: " Anup Vishwakarma
2026-10-06  9:30   ` Mukesh Ojha
2026-10-06 11:33     ` Anup Vishwakarma
2026-10-06  9:31 ` [PATCH 0/2] mailbox: " Mukesh Ojha

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=20261006093533.vbaihilgcbxonefv@hu-mojha-hyd.qualcomm.com \
    --to=mukesh.ojha@oss.qualcomm.com \
    --cc=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=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®