Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2887131rwb; Mon, 15 Aug 2022 13:20:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR7evF53Rkuh7iCjExfP7aO5qqs8Z2zDPZEes8/hiSVDGTmxysypIdZOLyQu2SksXyv5dlxI X-Received: by 2002:a17:907:761b:b0:738:4c1c:7dd with SMTP id jx27-20020a170907761b00b007384c1c07ddmr4289047ejc.563.1660594802744; Mon, 15 Aug 2022 13:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594802; cv=none; d=google.com; s=arc-20160816; b=ddSYDGfmesk8CxPb3v8VU0rN3Bpc8M1zDIZtv3jxc1zI20ETZkakH/cKjJtN9ToPRu 0cGVFF3lNbn0eH2Gk9iyU4SaWAbbmYFdTkUHu7c2vJY9KYxJqA5XdmhKh7o/eC5RF+ZX eATpzkplS6PAkPJJMHqIrkHSAcRCgKw2HwCLXu3ItQrhg97BGRd1NYryKUPwVPwKEPub mAnvdnORDY1P47hvtke82tWB6+oJ7skAzQhOigoLKk+VauZcCO5exBuCfpK36IiAH28d DAMJZkToRsu55wUM1EkKaMhxnBfnKlXxQTkklRWrsr8hDcIrD31EIpCX0LSm9ob08xBN 1VGw== 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=YMH/iRV/9L/VbTFiSAMTrpus3XU6f4i3r8PThGE2WOIYzgg1pRaDtky+Sh++uWMMke VelBFykFfZEVMDQpt5g1/ZRIl9wn03sliZnOFUfi9edTNrzzHoM4EXA3ChMr5qm2tQLk utQrqS9jtza6PZunb2sNws0jfAdgIxIZCVG5lxdkRd6xdm17kq41nIFn24hWDbfafPd+ IPqbhtnFaFLl0PuScFPSOpduZ8I3vLioU/TYbrusx/Ng6z4FBlrZ4eVloCPrseOa335u 5yvB74bw04xlOX5Lk66tVCT84vtWNnB25TmDTqZm3JYpAARV6T+hsC0GO2FYxLx5YYIW XTgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GIBRNcik; 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 kt27-20020a170906aadb00b00732f74db44dsi6854228ejb.17.2022.08.15.13.19.34; Mon, 15 Aug 2022 13:20:02 -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=GIBRNcik; 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 S1344994AbiHOTsG (ORCPT + 99 others); Mon, 15 Aug 2022 15:48:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345308AbiHOTqX (ORCPT ); Mon, 15 Aug 2022 15:46:23 -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 3E1296E2EB; Mon, 15 Aug 2022 11:49:01 -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 34A6E60FB8; Mon, 15 Aug 2022 18:49:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F51CC433D6; Mon, 15 Aug 2022 18:48:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589339; bh=cdnhM6keGBCbekNFSqz0/UM3k8voCBSTZYS+WXXc1WE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GIBRNcikMgrgfZ7qgb74E4aXCRXlCGiu3aBT92uFqpXHtnOg1X3Ws4V08NChk8uzF 45/F/AU9B4V9M8shLugi5akc4q43ZVlohac9OBYfqemlCFdfKNxiapEk+dNgd4fbkr QW2jJGQOg1mayfTLIPp4ghQ+js8PdxgwES1LGqy4= 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.15 687/779] Input: gscps2 - check return value of ioremap() in gscps2_probe() Date: Mon, 15 Aug 2022 20:05:31 +0200 Message-Id: <20220815180406.712047894@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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);