mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] gpib: ines: fix I/O region leak in ines_isa_attach() error path
       [not found] <20260527183225.1307330-1-tony@tonybtw.com>
@ 2026-07-17 12:29 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-17 12:29 UTC (permalink / raw)
  To: Tony Btw
  Cc: Dave Penkler, linux-kernel, kernel test robot, Dan Carpenter, stable

On Wed, May 27, 2026 at 11:32:25AM -0700, Tony Btw wrote:
> If request_irq() fails after request_region() has succeeded,
> ines_isa_attach() returns without releasing the I/O region. This
> leaks the region and prevents a subsequent attach attempt from
> acquiring it.
> 
> Release the region on the failure path.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202605271229.d8wGTffx-lkp@intel.com/
> Fixes: e6ab504633e4 ("staging: gpib: Destage gpib")
> Cc: stable <stable@kernel.org>
> Signed-off-by: Tony Btw <tony@tonybtw.com>

Need a real name please.

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

* [PATCH] gpib: ines: fix I/O region leak in ines_isa_attach() error path
@ 2026-05-27 20:46 tonybanters
  0 siblings, 0 replies; 2+ messages in thread
From: tonybanters @ 2026-05-27 20:46 UTC (permalink / raw)
  To: Dave Penkler
  Cc: Greg Kroah-Hartman, linux-kernel, kernel test robot,
	Dan Carpenter, stable

If request_irq() fails after request_region() has succeeded,
ines_isa_attach() returns without releasing the I/O region. This
leaks the region and prevents a subsequent attach attempt from
acquiring it.

Release the region on the failure path.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202605271229.d8wGTffx-lkp@intel.com/
Fixes: e6ab504633e4 ("staging: gpib: Destage gpib")
Cc: stable <stable@kernel.org>
Signed-off-by: tonybanters <tonybanters@gmail.com>
---
 drivers/gpib/ines/ines_gpib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpib/ines/ines_gpib.c b/drivers/gpib/ines/ines_gpib.c
index c000f647fbb..cb6ee6882a0 100644
--- a/drivers/gpib/ines/ines_gpib.c
+++ b/drivers/gpib/ines/ines_gpib.c
@@ -911,6 +911,7 @@ static int ines_isa_attach(struct gpib_board *board, const struct gpib_board_con
 	nec7210_board_reset(nec_priv, board);
 	if (request_irq(config->ibirq, ines_pci_interrupt, isr_flags, DRV_NAME, board)) {
 		dev_err(board->gpib_dev, "failed to allocate IRQ %d\n", config->ibirq);
+		release_region(config->ibbase, ines_isa_iosize);
 		return -1;
 	}
 	ines_priv->irq = config->ibirq;
-- 
2.54.0


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

end of thread, other threads:[~2026-07-17 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20260527183225.1307330-1-tony@tonybtw.com>
2026-07-17 12:29 ` [PATCH] gpib: ines: fix I/O region leak in ines_isa_attach() error path Greg Kroah-Hartman
2026-05-27 20:46 tonybanters

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®