All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Slavin Liu <bolin.liu@seu.edu.cn>
Cc: dpenkler@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] gpib: hp82335: check the register mapping before requesting IRQ
Date: Fri, 11 Sep 2026 08:28:30 +0200	[thread overview]
Message-ID: <2026091120-caviar-nicotine-9cda@gregkh> (raw)
In-Reply-To: <20260911060927.94461-1-bolin.liu@seu.edu.cn>

On Fri, Sep 11, 2026 at 02:09:27PM +0800, Slavin Liu wrote:
> 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;

You just leaked memory :(

      reply	other threads:[~2026-09-11  6:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026091120-caviar-nicotine-9cda@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=bolin.liu@seu.edu.cn \
    --cc=dpenkler@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.