mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: studentxswpy@163.com, James.Bottomley@HansenPartnership.com,
	dmitry.torokhov@gmail.com, linux-parisc@vger.kernel.org,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Hacash Robot <hacashRobot@santino.com>
Subject: Re: [PATCH] Input: check the return value of ioremap() in gscps2_probe()
Date: Tue, 2 Aug 2022 10:35:27 +0200	[thread overview]
Message-ID: <16dfaab2-bce5-6f07-7c18-d568f4719d75@gmx.de> (raw)
In-Reply-To: <20220802072033.3211980-1-studentxswpy@163.com>

On 8/2/22 09:20, studentxswpy@163.com wrote:
> From: Xie Shaowen <studentxswpy@163.com>
>
> The function ioremap() in gscps2_probe() can fail, so
> its return value should be checked.
>
> Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache")
> Reported-by: Hacash Robot <hacashRobot@santino.com>
> Signed-off-by: Xie Shaowen <studentxswpy@163.com>

I've applied it to the parisc git tree.

Thanks!
Helge

> ---
>  drivers/input/serio/gscps2.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
> index a9065c6ab550..da2c67cb8642 100644
> --- a/drivers/input/serio/gscps2.c
> +++ b/drivers/input/serio/gscps2.c
> @@ -350,6 +350,10 @@ static int __init gscps2_probe(struct parisc_device *dev)
>  	ps2port->port = serio;
>  	ps2port->padev = dev;
>  	ps2port->addr = ioremap(hpa, GSC_STATUS + 4);
> +	if (!ps2port->addr) {
> +		ret = -ENOMEM;
> +		goto fail_nomem;
> +	}
>  	spin_lock_init(&ps2port->lock);
>
>  	gscps2_reset(ps2port);


      reply	other threads:[~2022-08-02  8:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02  7:20 studentxswpy
2022-08-02  8:35 ` Helge Deller [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=16dfaab2-bce5-6f07-7c18-d568f4719d75@gmx.de \
    --to=deller@gmx.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hacashRobot@santino.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=studentxswpy@163.com \
    /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

all inboxes | Powered by JetHome®