[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220819153849.514435427@linuxfoundation.org>
Date: Fri, 19 Aug 2022 17:43:39 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Hacash Robot <hacashRobot@...tino.com>,
Xie Shaowen <studentxswpy@....com>,
Helge Deller <deller@....de>
Subject: [PATCH 5.10 449/545] Input: gscps2 - check return value of ioremap() in gscps2_probe()
From: Xie Shaowen <studentxswpy@....com>
commit e61b3125a4f036b3c6b87ffd656fc1ab00440ae9 upstream.
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@...r.kernel.org> # v5.6+
Reported-by: Hacash Robot <hacashRobot@...tino.com>
Signed-off-by: Xie Shaowen <studentxswpy@....com>
Signed-off-by: Helge Deller <deller@....de>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/input/serio/gscps2.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -350,6 +350,10 @@ static int __init gscps2_probe(struct pa
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);
Powered by blists - more mailing lists