* [PATCH] MIPS: Fix a reference leak bug in ip22_check_gio()
@ 2025-12-04 10:36 Haoxiang Li
2025-12-05 11:54 ` Maciej W. Rozycki
2025-12-15 17:17 ` Thomas Bogendoerfer
0 siblings, 2 replies; 3+ messages in thread
From: Haoxiang Li @ 2025-12-04 10:36 UTC (permalink / raw)
To: tsbogend, haoxiang_li2024, FlorianSchandinat
Cc: linux-mips, linux-kernel, stable
If gio_device_register fails, gio_dev_put() is required to
drop the gio_dev device reference.
Fixes: e84de0c61905 ("MIPS: GIO bus support for SGI IP22/28")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
arch/mips/sgi-ip22/ip22-gio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c
index 5893ea4e382c..19b70928d6dc 100644
--- a/arch/mips/sgi-ip22/ip22-gio.c
+++ b/arch/mips/sgi-ip22/ip22-gio.c
@@ -372,7 +372,8 @@ static void ip22_check_gio(int slotno, unsigned long addr, int irq)
gio_dev->resource.flags = IORESOURCE_MEM;
gio_dev->irq = irq;
dev_set_name(&gio_dev->dev, "%d", slotno);
- gio_device_register(gio_dev);
+ if (gio_device_register(gio_dev))
+ gio_dev_put(gio_dev);
} else
printk(KERN_INFO "GIO: slot %d : Empty\n", slotno);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: Fix a reference leak bug in ip22_check_gio()
2025-12-04 10:36 [PATCH] MIPS: Fix a reference leak bug in ip22_check_gio() Haoxiang Li
@ 2025-12-05 11:54 ` Maciej W. Rozycki
2025-12-15 17:17 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2025-12-05 11:54 UTC (permalink / raw)
To: Haoxiang Li
Cc: Thomas Bogendoerfer, FlorianSchandinat, linux-mips, linux-kernel
On Thu, 4 Dec 2025, Haoxiang Li wrote:
> If gio_device_register fails, gio_dev_put() is required to
> drop the gio_dev device reference.
>
> Fixes: e84de0c61905 ("MIPS: GIO bus support for SGI IP22/28")
> Cc: stable@vger.kernel.org
Even if this does ever trigger in reality, it's seems like a benign issue
that does not qualify for the -stable tree. Please read the first section
of Documentation/process/stable-kernel-rules.rst for the acceptance rules
and if you still think this needs to be backported, then give rationale.
Maciej
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: Fix a reference leak bug in ip22_check_gio()
2025-12-04 10:36 [PATCH] MIPS: Fix a reference leak bug in ip22_check_gio() Haoxiang Li
2025-12-05 11:54 ` Maciej W. Rozycki
@ 2025-12-15 17:17 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2025-12-15 17:17 UTC (permalink / raw)
To: Haoxiang Li; +Cc: FlorianSchandinat, linux-mips, linux-kernel, stable
On Thu, Dec 04, 2025 at 06:36:18PM +0800, Haoxiang Li wrote:
> If gio_device_register fails, gio_dev_put() is required to
> drop the gio_dev device reference.
>
> Fixes: e84de0c61905 ("MIPS: GIO bus support for SGI IP22/28")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> ---
> arch/mips/sgi-ip22/ip22-gio.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c
> index 5893ea4e382c..19b70928d6dc 100644
> --- a/arch/mips/sgi-ip22/ip22-gio.c
> +++ b/arch/mips/sgi-ip22/ip22-gio.c
> @@ -372,7 +372,8 @@ static void ip22_check_gio(int slotno, unsigned long addr, int irq)
> gio_dev->resource.flags = IORESOURCE_MEM;
> gio_dev->irq = irq;
> dev_set_name(&gio_dev->dev, "%d", slotno);
> - gio_device_register(gio_dev);
> + if (gio_device_register(gio_dev))
> + gio_dev_put(gio_dev);
> } else
> printk(KERN_INFO "GIO: slot %d : Empty\n", slotno);
> }
> --
> 2.25.1
applied to mips-fixes
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-15 17:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04 10:36 [PATCH] MIPS: Fix a reference leak bug in ip22_check_gio() Haoxiang Li
2025-12-05 11:54 ` Maciej W. Rozycki
2025-12-15 17:17 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).