linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Haotian Zhang <vulab@iscas.ac.cn>
Cc: dpenkler@gmail.com, matchstick@neverthere.org,
	niharchaithanya@gmail.com, paul.retourne@orange.fr,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: gpib: ines: Check the return value of ioremap()
Date: Wed, 26 Nov 2025 14:26:47 +0100	[thread overview]
Message-ID: <2025112622-absently-remarry-3b51@gregkh> (raw)
In-Reply-To: <20251126013618.1052-1-vulab@iscas.ac.cn>

On Wed, Nov 26, 2025 at 09:36:18AM +0800, Haotian Zhang wrote:
> The function ioremap() in ines_gpib_config() can fail and return NULL,
> which is dereferenced without checking, leading to a NULL pointer
> dereference.
> 
> Add a check for the return value of ioremap() and return -ENOMEM on
> failure.
> 
> Fixes: bb1bd92fa0f2 ("staging: gpib: Add ines GPIB driver")
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---
>  drivers/staging/gpib/ines/ines_gpib.c | 5 +++++

This file has now moved :(

And do you have this hardware to test this with?  If so, a lot more
cleanup can be done in this function.

thanks,

greg k-h

      reply	other threads:[~2025-11-26 13:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  1:36 [PATCH] staging: gpib: ines: Check the return value of ioremap() Haotian Zhang
2025-11-26 13:26 ` 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=2025112622-absently-remarry-3b51@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dpenkler@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=matchstick@neverthere.org \
    --cc=niharchaithanya@gmail.com \
    --cc=paul.retourne@orange.fr \
    --cc=vulab@iscas.ac.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).