diff options
author | Xie Shaowen <studentxswpy@163.com> | 2022-08-02 10:20:33 +0300 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-08-02 11:31:59 +0300 |
commit | e61b3125a4f036b3c6b87ffd656fc1ab00440ae9 (patch) | |
tree | 62e32593ebf2dc60ccd76d64b70b98784b68cc04 /drivers/input/serio | |
parent | 6431e92fc827bdd2d28f79150d90415ba9ce0d21 (diff) | |
download | linux-e61b3125a4f036b3c6b87ffd656fc1ab00440ae9.tar.xz |
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: 4bdc0d676a643 ("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>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r-- | drivers/input/serio/gscps2.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |