Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3081891rwb; Mon, 15 Aug 2022 17:40:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR6cK3x+AbbmK9iHcEpelAdCQODZJctUzZlw9yopoRPkh8ii93ZnGX6FUiVV2wObinWpgkU2 X-Received: by 2002:a17:902:7242:b0:171:398d:9e66 with SMTP id c2-20020a170902724200b00171398d9e66mr20025151pll.19.1660610451624; Mon, 15 Aug 2022 17:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610451; cv=none; d=google.com; s=arc-20160816; b=MDqTke+ZPpJnZlZQ8Lxg2wEcTD7GagpNevZD1sPykoe8uYIk2Oqme8+yvUqZ9tQNIU 05kkg9F6f6tK/QmwSKaqIr3hJSp/82JCbSMLCGhi8XdPvBx3FsN0baXtVX5UfyPePCAp 78boPCgn2sSw8r2ARrw8I6y2SUHb5phxCbhZ9YuzFPzSH42jaSg8LnsLogu9cq58JLNZ hgLJ55C2ktRQMQ4TC6AZrKy0r/OAeaozc8DhmZnKVrfxrrx23AtrsIIuTA6jQe3Y5F8D yF0j9cH4ef69zATEvKIAT+kbFgB4joSeCOp9YnvmMS80DuFrQpYSofF/E/e4ylBkIJIA aQ7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/kaeG3EYih5b/TomOpx/zSs4CbhSlMluq0DgPsHBouQ=; b=XgStMKnxTHF0gTDgxDU3eC7sE0nPfCSVhPNiSAS4nM1baV/JdrOk9wiTeuB8IwmktZ 1quFtPPCP0+BxKK9jyIoDoCiJ9y2aIMFasmZ5FchV/9ehvaQqjw3QrnQ6ebALgldXlkd gNAxJdIjvLbu+KAv16gVCAcE9tCtg65hYJ6Neda7LgGaNMAcEyYFz9flrOE4kURKDQ7w RIHH1cfHZYhsTY88xNN+Q2chUhI206Rl9LWDG+etsRTIg7jR1B8Xkd/f9e2Px2j0lTgG 6LaNeokicPT7CJkhMul7Mp8fO5GoAAu5sq6y8lbE11+qOZBCdMv6RJ+uFJiKrWw5MCMD 59xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=unsyrNhh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a63d742000000b0041dd0c2ef5asi12303241pgi.421.2022.08.15.17.40.40; Mon, 15 Aug 2022 17:40:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=unsyrNhh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346075AbiHOXNE (ORCPT + 99 others); Mon, 15 Aug 2022 19:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345415AbiHOXMD (ORCPT ); Mon, 15 Aug 2022 19:12:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12CC87667; Mon, 15 Aug 2022 13:00:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 935F160FD8; Mon, 15 Aug 2022 20:00:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 829FEC433C1; Mon, 15 Aug 2022 20:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593622; bh=cdnhM6keGBCbekNFSqz0/UM3k8voCBSTZYS+WXXc1WE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=unsyrNhhB0r7ctUVGJGgPxb1QvAEZoWqriUcd+FsSvc4g0MY0hI+Y6ot/j0lclWCh Y3RpMNs6eyx93QLaWMB1+n5ECV2OCNSRzsKHeF2vcDfnN93TkLPeXUC4U9l/64m7rB 7iQw1st3OvzR+hNaX8pMWoiWhtB4jGn6sVW3lJE8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hacash Robot , Xie Shaowen , Helge Deller Subject: [PATCH 5.18 0977/1095] Input: gscps2 - check return value of ioremap() in gscps2_probe() Date: Mon, 15 Aug 2022 20:06:16 +0200 Message-Id: <20220815180509.534782564@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xie Shaowen 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: # v5.6+ Reported-by: Hacash Robot Signed-off-by: Xie Shaowen Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- 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);