All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Hovold <johan@kernel.org>,
	stable@vger.kernel.org
Subject: [PATCH 3/5] MIPS: ip22-gio: fix device reference leak in probe
Date: Fri, 24 Apr 2026 12:28:47 +0200	[thread overview]
Message-ID: <20260424102849.2616035-4-johan@kernel.org> (raw)
In-Reply-To: <20260424102849.2616035-1-johan@kernel.org>

The gio probe function needlessly takes a device reference which is
never released and therefore prevents unbound gio devices from being
freed.

Fixes: e84de0c61905 ("MIPS: GIO bus support for SGI IP22/28")
Cc: stable@vger.kernel.org	# 3.3
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 arch/mips/sgi-ip22/ip22-gio.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c
index 2f5c6c6f8254..7b7572d11250 100644
--- a/arch/mips/sgi-ip22/ip22-gio.c
+++ b/arch/mips/sgi-ip22/ip22-gio.c
@@ -133,13 +133,9 @@ static int gio_device_probe(struct device *dev)
 	if (!drv->probe)
 		return error;
 
-	gio_dev_get(gio_dev);
-
 	match = gio_match_device(drv->id_table, gio_dev);
 	if (match)
 		error = drv->probe(gio_dev, match);
-	if (error)
-		gio_dev_put(gio_dev);
 
 	return error;
 }
-- 
2.53.0


  parent reply	other threads:[~2026-04-24 10:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 10:28 [PATCH 0/5] MIPS: ip22-gio: fix leaks and replace static root Johan Hovold
2026-04-24 10:28 ` [PATCH 1/5] MIPS: ip22-gio: fix kfree() of static object Johan Hovold
2026-04-24 10:28 ` [PATCH 2/5] MIPS: ip22-gio: fix gio device memory leak Johan Hovold
2026-04-24 10:28 ` Johan Hovold [this message]
2026-04-24 10:28 ` [PATCH 4/5] MIPS: ip22-gio: switch to dynamic root device Johan Hovold
2026-04-24 10:28 ` [PATCH 5/5] MIPS: ip22-gio: do not export device release function Johan Hovold
2026-05-27  8:06 ` [PATCH 0/5] MIPS: ip22-gio: fix leaks and replace static root Thomas Bogendoerfer

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=20260424102849.2616035-4-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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 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.