Skip to contentSkip to conversation

gpib: ines: fix I/O region leak in ines_isa_attach() error path

PATCH New Tony Sanchez 1 participant 1 message Jul 23 GPIB drivers

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 gpib: ines: fix I/O region leak in ines_isa_attach() error path

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.

---
v3: Fix From: header to real name (was overridden by git config in v2).
v2: Use real name in Signed-off-by (Greg KH).

 drivers/gpib/ines/ines_gpib.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpib/ines/ines_gpib.c +1 -0
index c000f647fbb..cb6ee6882a0 100644
@@ -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;
Signature · 1 line
2.54.0