Skip to content

Commit e61b312

Browse files
liunxXswhdeller
authored andcommitted
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: 4bdc0d6 ("remove ioremap_nocache and devm_ioremap_nocache") Cc: <[email protected]> # v5.6+ Reported-by: Hacash Robot <[email protected]> Signed-off-by: Xie Shaowen <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 6431e92 commit e61b312

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/input/serio/gscps2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,10 @@ static int __init gscps2_probe(struct parisc_device *dev)
350350
ps2port->port = serio;
351351
ps2port->padev = dev;
352352
ps2port->addr = ioremap(hpa, GSC_STATUS + 4);
353+
if (!ps2port->addr) {
354+
ret = -ENOMEM;
355+
goto fail_nomem;
356+
}
353357
spin_lock_init(&ps2port->lock);
354358

355359
gscps2_reset(ps2port);

0 commit comments

Comments
 (0)