Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1863899rwb; Fri, 19 Aug 2022 10:38:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR65ccO8qecmbLK8FezFJnwkm8qnBGPZ8YuUhKJiPk5Hgh2WCgBwTiTNnwjjBfCIFtk7fSmo X-Received: by 2002:a63:88c8:0:b0:41d:260c:ea29 with SMTP id l191-20020a6388c8000000b0041d260cea29mr7054281pgd.284.1660930732036; Fri, 19 Aug 2022 10:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930732; cv=none; d=google.com; s=arc-20160816; b=VM2TmbdnZaY1b60Gfk7I/d2J1dA1fzTcdULf142KmdmQbgnH0iP3vjDVtpfmnyU/1h VGfI88/pAzxZQfKeASfbKWDN44WcmnSqpqYyJoyS9odjZyYSoTjTTF4TOM+H8H5pKwFu b2FFAlfJaGmI2MSHTjJvuO0SAF5gJIWlY9y1yFcpcdC+iZ30Zwklle9J+vMjk7bFJSbY Qh5ljra9927mVA834ISSGsXbWlTwCQiKlrhFmEwqM05mTcKrtYLHg9eut0OSd4S18lwK XEyx0e3kclMvzGUkrMHvWPHifymah1pbYTXAkEwMpO43uvzhD5967WYNskqSs02RlMEH JwaA== 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=WI6SBvtAhRUdKyy9s+7IW1pmviLAO4zVop8iTuh+rK4=; b=DRlcs04XhnDkjwj22oR2Gcv80N9Qkx0okwKp4UC1lDbZcPVQgPYvSXdUYF5hCiZYZJ kPoHvTmSqWTry9H6ZMgazs1TcuqMIhriRS1JxX7V66XfzCPhvW9DgTJZV4UhgH7ouw0z 3R0wH7Nq8bVDVXVbo2m3odJp7Y3EDsw61Yw2ZRWynxoR4hafikrfUlhXN3qlCh9saq52 AKhQN7FKMiu6mw5r+VtvqF6Vrw2nj7RLWliaa04ZWgaV5tK1NbM7ZpbSlN8grUUp0nGv i+hYLwu/KhKXzCnev+sQrSPb4bHYZpdXA8DnpxQW88wSPHKj0sIcANoiklX9zoAejfc8 JRmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PUQgltDi; 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 j62-20020a638041000000b00429a2bb8766si2593279pgd.643.2022.08.19.10.38.41; Fri, 19 Aug 2022 10:38:52 -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=PUQgltDi; 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 S1349063AbiHSPtx (ORCPT + 99 others); Fri, 19 Aug 2022 11:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350288AbiHSPtO (ORCPT ); Fri, 19 Aug 2022 11:49:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01B3A104760; Fri, 19 Aug 2022 08:47:39 -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 ams.source.kernel.org (Postfix) with ESMTPS id F0FF8B82813; Fri, 19 Aug 2022 15:47:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53778C433D6; Fri, 19 Aug 2022 15:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924056; bh=Muz+6devd5UaSOJcMQZ9LRIIl260cRIsDAwDtiF54MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PUQgltDi544WphBHA0XX0H2wRU1NbAyIXHxKJIzRgOaDXrsauPmFbFYvhuHh0TGpA iCwVCWz/L5F6QOroth7CDtEuvcV8ut3VWIbkSrMsGl4yCxa97CI2Sbgwt/v8y3msmh 45Xarzu5DlENhd5MWb5aHp0Fzyre9dz6xrpkZ8ts= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hacash Robot , William Dean , Helge Deller Subject: [PATCH 5.10 040/545] parisc: Check the return value of ioremap() in lba_driver_probe() Date: Fri, 19 Aug 2022 17:36:50 +0200 Message-Id: <20220819153831.028012523@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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: William Dean commit cf59f34d7f978d14d6520fd80a78a5ad5cb8abf8 upstream. The function ioremap() in lba_driver_probe() can fail, so its return value should be checked. Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache") Reported-by: Hacash Robot Signed-off-by: William Dean Signed-off-by: Helge Deller Cc: # v5.6+ Signed-off-by: Greg Kroah-Hartman --- drivers/parisc/lba_pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1476,9 +1476,13 @@ lba_driver_probe(struct parisc_device *d u32 func_class; void *tmp_obj; char *version; - void __iomem *addr = ioremap(dev->hpa.start, 4096); + void __iomem *addr; int max; + addr = ioremap(dev->hpa.start, 4096); + if (addr == NULL) + return -ENOMEM; + /* Read HW Rev First */ func_class = READ_REG32(addr + LBA_FCLASS);