mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC] gpib: hp82335: check the register mapping before requesting IRQ
@ 2026-09-11  6:09 Slavin Liu
  2026-09-11  6:28 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Slavin Liu @ 2026-09-11  6:09 UTC (permalink / raw)
  To: dpenkler, gregkh; +Cc: linux-kernel, bolin.liu

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@seu.edu.cn>
---
 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) {

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

end of thread, other threads:[~2026-09-11  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11  6:09 [PATCH RFC] gpib: hp82335: check the register mapping before requesting IRQ Slavin Liu
2026-09-11  6:28 ` Greg KH

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®