Commit e61b3125 authored by Xie Shaowen's avatar Xie Shaowen Committed by Helge Deller

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

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

Fixes: 4bdc0d67 ("remove ioremap_nocache and devm_ioremap_nocache")
Cc: <stable@vger.kernel.org> # v5.6+
Reported-by: default avatarHacash Robot <hacashRobot@santino.com>
Signed-off-by: default avatarXie Shaowen <studentxswpy@163.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 6431e92f
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment