[PATCH RFC] gpib: hp82335: check the register mapping before requesting IRQ
From: Slavin Liu
Date: Fri Sep 11 2026 - 02:13:06 EST
Stop attach on mapping failure before board reset or register access.
The existing detach path handles the reserved region and private state.
Detected by static analysis and reviewed with AI-assisted source auditing.
Fixes: 76319a9d234f ("staging: gpib: Add hp82335x GPIB driver")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@xxxxxxxxxx>
---
drivers/gpib/hp_82335/hp82335.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpib/hp_82335/hp82335.c b/drivers/gpib/hp_82335/hp82335.c
index b7544b3c15c6..b1ef3dbdcdab 100644
--- a/drivers/gpib/hp_82335/hp82335.c
+++ b/drivers/gpib/hp_82335/hp82335.c
@@ -290,6 +290,8 @@ static int hp82335_attach(struct gpib_board *board, const struct gpib_board_conf
}
hp_priv->raw_iobase = upper_iomem_base;
tms_priv->mmiobase = ioremap(upper_iomem_base, hp82335_upper_iomem_size);
+ if (!tms_priv->mmiobase)
+ return -ENOMEM;
retval = request_irq(config->ibirq, hp82335_interrupt, 0, DRV_NAME, board);
if (retval) {