Re: [PATCH] gpib: cb7210: Fix region leak when request_irq fails
From: Dominik Karol Piątkowski
Date: Thu May 28 2026 - 13:52:56 EST
Hi,
This patch is already in linux-next, but I see a problem similar to what I've
found here:
https://lore.kernel.org/all/LpJShJPaUZ8iZoWRA7Sy9TPz_7ZPHNvoU0lHOBrVEXvQGqlz493ShbF6ZKQ2zcRqPHVuxOkjzR0KCdS6OngnflPYa0gsqaRTpRWFbxuqQ4A=@protonmail.com/
I believe this patch should be reverted.
Thanks,
Dominik Karol
On Sunday, May 3rd, 2026 at 11:30, Hongling Zeng <zenghongling@xxxxxxxxxx> wrote:
> When request_irq() fails, the region allocated by request_region()
> is not released. Fix this by calling release_region() before returning.
>
> Smatch warning:
> drivers/gpib/cb7210/cb7210.c:1068 cb_isa_attach() warn: 'config->ibbase'
> from __request_region() not released on lines: 1064.
>
> Fixes: 82e3508046f9b ("gpib: cb7210: add isa support module")
> Signed-off-by: Hongling Zeng <zenghongling@xxxxxxxxxx>
> ---
> drivers/gpib/cb7210/cb7210.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpib/cb7210/cb7210.c b/drivers/gpib/cb7210/cb7210.c
> index 6dd8637c5964..05058bf2cd50 100644
> --- a/drivers/gpib/cb7210/cb7210.c
> +++ b/drivers/gpib/cb7210/cb7210.c
> @@ -1062,6 +1062,7 @@ static int cb_isa_attach(struct gpib_board *board, const struct gpib_board_confi
> // install interrupt handler
> if (request_irq(config->ibirq, cb7210_interrupt, isr_flags, DRV_NAME, board)) {
> dev_err(board->gpib_dev, "failed to obtain IRQ %d\n", config->ibirq);
> + release_region(nec7210_iobase(cb_priv), cb7210_iosize);
> return -EBUSY;
> }
> cb_priv->irq = config->ibirq;
> --
> 2.25.1
>
>