All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe()
@ 2026-03-15  7:17 Felix Gu
  2026-03-15 17:24 ` Rahul Pathak
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Felix Gu @ 2026-03-15  7:17 UTC (permalink / raw)
  To: Rahul Pathak, Anup Patel, Thomas Gleixner, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Jassi Brar, Sunil V L
  Cc: Anup Patel, linux-riscv, linux-kernel, Felix Gu

When riscv_acpi_get_gsi_info() fails, the mailbox channel previously
requested via mbox_request_channel() is not freed. Add the missing
mbox_free_channel() call to prevent the resource leak.

Fixes: 4752b0cfbc37 ("irqchip/riscv-rpmi-sysmsi: Add ACPI support")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/irqchip/irq-riscv-rpmi-sysmsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/irqchip/irq-riscv-rpmi-sysmsi.c b/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
index 5c74c561ce31..612f3972f7af 100644
--- a/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
+++ b/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
@@ -250,6 +250,7 @@ static int rpmi_sysmsi_probe(struct platform_device *pdev)
 		rc = riscv_acpi_get_gsi_info(fwnode, &priv->gsi_base, &id,
 					     &nr_irqs, NULL);
 		if (rc) {
+			mbox_free_channel(priv->chan);
 			dev_err(dev, "failed to find GSI mapping\n");
 			return rc;
 		}

---
base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900
change-id: 20260315-sysmsi-f6254f65701f

Best regards,
-- 
Felix Gu <ustc.gu@gmail.com>


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe()
  2026-03-15  7:17 [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe() Felix Gu
@ 2026-03-15 17:24 ` Rahul Pathak
  2026-03-16  8:15 ` Markus Elfring
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Rahul Pathak @ 2026-03-15 17:24 UTC (permalink / raw)
  To: Felix Gu
  Cc: Anup Patel, Albert Ou, Alexandre Ghiti, Anup Patel, Jassi Brar,
	linux-kernel, Palmer Dabbelt, Thomas Gleixner, Paul Walmsley,
	linux-riscv

On Sun, Mar 15, 2026 at 12:48 PM Felix Gu <ustc.gu@gmail.com> wrote:
>
> When riscv_acpi_get_gsi_info() fails, the mailbox channel previously
> requested via mbox_request_channel() is not freed. Add the missing
> mbox_free_channel() call to prevent the resource leak.
>
> Fixes: 4752b0cfbc37 ("irqchip/riscv-rpmi-sysmsi: Add ACPI support")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
>  drivers/irqchip/irq-riscv-rpmi-sysmsi.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/irqchip/irq-riscv-rpmi-sysmsi.c b/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
> index 5c74c561ce31..612f3972f7af 100644
> --- a/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
> +++ b/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
> @@ -250,6 +250,7 @@ static int rpmi_sysmsi_probe(struct platform_device *pdev)
>                 rc = riscv_acpi_get_gsi_info(fwnode, &priv->gsi_base, &id,
>                                              &nr_irqs, NULL);
>                 if (rc) {
> +                       mbox_free_channel(priv->chan);
>                         dev_err(dev, "failed to find GSI mapping\n");
>                         return rc;
>                 }
>

Reviewed-by: Rahul Pathak <rahul@summations.net>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe()
  2026-03-15  7:17 [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe() Felix Gu
  2026-03-15 17:24 ` Rahul Pathak
@ 2026-03-16  8:15 ` Markus Elfring
  2026-03-17 10:18 ` [tip: irq/urgent] " tip-bot2 for Felix Gu
  2026-03-24  6:07 ` [PATCH] " patchwork-bot+linux-riscv
  3 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2026-03-16  8:15 UTC (permalink / raw)
  To: Felix Gu, linux-riscv, Albert Ou, Alexandre Ghiti, Anup Patel,
	Jassi Brar, Palmer Dabbelt, Paul Walmsley, Rahul Pathak,
	Sunil V L, Thomas Gleixner
  Cc: LKML, Anup Patel

> When riscv_acpi_get_gsi_info() fails, the mailbox channel previously
> requested via mbox_request_channel() is not freed. Add the missing
> mbox_free_channel() call to prevent the resource leak.

How do you think about to increase the application of scope-based resource management?
https://elixir.bootlin.com/linux/v7.0-rc3/source/drivers/mailbox/mailbox.c#L465-L496
https://elixir.bootlin.com/linux/v7.0-rc3/source/drivers/irqchip/irq-riscv-rpmi-sysmsi.c#L210-L307


Were any source code analysis tools involved here?


See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v7.0-rc3#n34

Regards,
Markus

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: irq/urgent] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe()
  2026-03-15  7:17 [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe() Felix Gu
  2026-03-15 17:24 ` Rahul Pathak
  2026-03-16  8:15 ` Markus Elfring
@ 2026-03-17 10:18 ` tip-bot2 for Felix Gu
  2026-03-24  6:07 ` [PATCH] " patchwork-bot+linux-riscv
  3 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Felix Gu @ 2026-03-17 10:18 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Felix Gu, Thomas Gleixner, stable, Rahul Pathak, x86,
	linux-kernel, maz

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     76f0930d6e809234904cf9f0f5f42ee6c1dc694e
Gitweb:        https://git.kernel.org/tip/76f0930d6e809234904cf9f0f5f42ee6c1dc694e
Author:        Felix Gu <ustc.gu@gmail.com>
AuthorDate:    Sun, 15 Mar 2026 15:17:54 +08:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 17 Mar 2026 11:16:15 +01:00

irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe()

When riscv_acpi_get_gsi_info() fails, the mailbox channel previously
requested via mbox_request_channel() is not freed. Add the missing
mbox_free_channel() call to prevent the resource leak.

Fixes: 4752b0cfbc37 ("irqchip/riscv-rpmi-sysmsi: Add ACPI support")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Reviewed-by: Rahul Pathak <rahul@summations.net>
Link: https://patch.msgid.link/20260315-sysmsi-v1-1-5f090c86c2ca@gmail.com
---
 drivers/irqchip/irq-riscv-rpmi-sysmsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/irqchip/irq-riscv-rpmi-sysmsi.c b/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
index 5c74c56..612f397 100644
--- a/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
+++ b/drivers/irqchip/irq-riscv-rpmi-sysmsi.c
@@ -250,6 +250,7 @@ static int rpmi_sysmsi_probe(struct platform_device *pdev)
 		rc = riscv_acpi_get_gsi_info(fwnode, &priv->gsi_base, &id,
 					     &nr_irqs, NULL);
 		if (rc) {
+			mbox_free_channel(priv->chan);
 			dev_err(dev, "failed to find GSI mapping\n");
 			return rc;
 		}

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe()
  2026-03-15  7:17 [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe() Felix Gu
                   ` (2 preceding siblings ...)
  2026-03-17 10:18 ` [tip: irq/urgent] " tip-bot2 for Felix Gu
@ 2026-03-24  6:07 ` patchwork-bot+linux-riscv
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+linux-riscv @ 2026-03-24  6:07 UTC (permalink / raw)
  To: Felix Gu
  Cc: apatel, aou, alex, anup, jassisinghbrar, linux-kernel, rahul,
	palmer, tglx, pjw, linux-riscv

Hello:

This patch was applied to riscv/linux.git (for-next)
by Thomas Gleixner <tglx@kernel.org>:

On Sun, 15 Mar 2026 15:17:54 +0800 you wrote:
> When riscv_acpi_get_gsi_info() fails, the mailbox channel previously
> requested via mbox_request_channel() is not freed. Add the missing
> mbox_free_channel() call to prevent the resource leak.
> 
> Fixes: 4752b0cfbc37 ("irqchip/riscv-rpmi-sysmsi: Add ACPI support")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> 
> [...]

Here is the summary with links:
  - irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe()
    https://git.kernel.org/riscv/c/76f0930d6e80

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-24  6:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-15  7:17 [PATCH] irqchip/riscv-rpmi-sysmsi: Fix mailbox channel leak in rpmi_sysmsi_probe() Felix Gu
2026-03-15 17:24 ` Rahul Pathak
2026-03-16  8:15 ` Markus Elfring
2026-03-17 10:18 ` [tip: irq/urgent] " tip-bot2 for Felix Gu
2026-03-24  6:07 ` [PATCH] " patchwork-bot+linux-riscv

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.