Input: gscps2 - check return value of ioremap() in gscps2_probe()

commit e61b3125a4 upstream.

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

Fixes: 4bdc0d676a ("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>
This commit is contained in:
Xie Shaowen 2022-08-02 15:20:33 +08:00 committed by Greg Kroah-Hartman
parent e8cb6e8fd9
commit f0bb938803
1 changed files with 4 additions and 0 deletions

View File

@ -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);