Skip to content

Commit

Permalink
Input: gscps2 - check return value of ioremap() in gscps2_probe()
Browse files Browse the repository at this point in the history
commit e61b312 upstream.

The function ioremap() in gscps2_probe() can fail, so
its return value should be checked.

Fixes: 4bdc0d6 ("remove ioremap_nocache and devm_ioremap_nocache")
Cc: <stable@vger.kernel.org> # v5.6+
Reported-by: Hacash Robot <hacashRobot@santino.com>
Signed-off-by: Xie Shaowen <studentxswpy@163.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
liunxXsw authored and gregkh committed Aug 17, 2022
1 parent 9e255ed commit 60c981f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/input/serio/gscps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 60c981f

Please sign in to comment.