lkml.org 
[lkml]   [2022]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.18 0977/1095] Input: gscps2 - check return value of ioremap() in gscps2_probe()
    Date
    From: Xie Shaowen <studentxswpy@163.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@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>
    ---
    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);

    \
     
     \ /
      Last update: 2022-08-16 01:14    [W:4.539 / U:0.644 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site