Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3098555rwb; Mon, 15 Aug 2022 18:04:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR500hxNaUncA9F+Qy9dsujethdrwDj8H9NCW0zQf5eNKHlz+0cMsytjWMIujLNcAf2J0EnR X-Received: by 2002:aa7:c396:0:b0:43d:2d78:ee19 with SMTP id k22-20020aa7c396000000b0043d2d78ee19mr16543444edq.322.1660611864212; Mon, 15 Aug 2022 18:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611864; cv=none; d=google.com; s=arc-20160816; b=PsO1LnGwxOfM546D1JTmO6+GrtFrVTOw8VHTaUQV47DbE2JPkMCiDktkMM4iZttBY2 oFmDipjX7yPxTOqd1Oy2g4x2KrDLTJirt1QlG9rJ3cgABQi/+bEp8CQgm7j2OJayVQKI HkBY9EmICFhrWHDI4ZITC8624jqvsTOAtnoEC6HNcptPq8mOxa/57d5PqQ3Q7e1J/R7U +HymgVWrGUPR9MaZhGXpGcyJiT5UpZCdsYewFbYghXwcI2zGo6vsZJFxfVwv9WKnSks8 yN8MXRLo+E5LIunQGJjoRuYKCVWtckuRvhwF6a+/9FaEIlqFymX4YkimTzVEBt2lZrJk GhvA== 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=c+xiIZPy3DM7GCwcTlLQwFn144OIUDxGEOlFMeuPpXu1PdgaoxKrJDm2uCMQ8U7IOL emLKdRUfvoLcqDvcJzPd4dweyGcDd8ZAvDrDND4q3VQzzcbxoTRjIt8gAT8upC3PKbl/ A6hyPOb+VqP6S0yiiWPpTasruyykaTX1RNpA9yLaNUJ4ytucs51lQy2w5uyWWUDfXB2c 1GOb/XOVK3D24QR0GGURLVl/0HvAmcByfcZQ0ao76Y8zCblixxX/PZa9Mq5HEFet6gYn B7PJlsiK3YBJD+Y8Asm4qmahFgtXayUcPugO4BrN4CE5mFbJ80eRJpypXqJ4+k8Ux/F0 DFvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PfzmuOmG; 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 d12-20020a05640208cc00b0043e1358f449si7887064edz.621.2022.08.15.18.03.31; Mon, 15 Aug 2022 18:04:24 -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=PfzmuOmG; 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 S1345680AbiHPBBJ (ORCPT + 99 others); Mon, 15 Aug 2022 21:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244245AbiHPAyQ (ORCPT ); Mon, 15 Aug 2022 20:54:16 -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 B5A9419C9C2; Mon, 15 Aug 2022 13:47:40 -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 AB5F061243; Mon, 15 Aug 2022 20:47:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C80EC433C1; Mon, 15 Aug 2022 20:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596459; bh=cdnhM6keGBCbekNFSqz0/UM3k8voCBSTZYS+WXXc1WE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PfzmuOmGdmiPWhqcqyHD+VU+KPos89R98idKx57TphytpWY2mq8fKYqYptvJ53MfE 32tK8o13ktSVho1JqQqR+K/IIly7VxtqUqarYJNcQZSt1vYeH6keUv6IjoeONOuGlq LR3NGmp9hiJmjC1CLHjRWWmai0YWoppUcupkRmF0= 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.19 1052/1157] Input: gscps2 - check return value of ioremap() in gscps2_probe() Date: Mon, 15 Aug 2022 20:06:48 +0200 Message-Id: <20220815180522.139133639@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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);