linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Haoxiang Li <haoxiang_li2024@163.com>
Cc: FlorianSchandinat@gmx.de, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] MIPS: Fix a reference leak bug in ip22_check_gio()
Date: Mon, 15 Dec 2025 18:17:37 +0100	[thread overview]
Message-ID: <aUBCsTeplCT6oNO-@alpha.franken.de> (raw)
In-Reply-To: <20251204103618.89502-1-haoxiang_li2024@163.com>

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 ]

      parent reply	other threads:[~2025-12-15 17:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=aUBCsTeplCT6oNO-@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=FlorianSchandinat@gmx.de \
    --cc=haoxiang_li2024@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).