Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2890910rwb; Mon, 15 Aug 2022 13:25:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Jpc/FN606yoLkJuHWysLOOYy2pfgKtPEZi9C28pd/xLjrmHzomktEWlQqArfXkYw1uF2I X-Received: by 2002:a17:907:a0c6:b0:730:f081:6e8e with SMTP id hw6-20020a170907a0c600b00730f0816e8emr11272579ejc.479.1660595027627; Mon, 15 Aug 2022 13:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660595027; cv=none; d=google.com; s=arc-20160816; b=nhm+ASY8WJIqhWXtlSS3gzbvzLQbZUeyIXRR+2rO2z6gyYQRJiP1ugfY/HnDyw2W06 0ivQXUhinCfuvQ+1wcN1UbrUBoM6V8V0qDtwyacXHDp7YXjMr57TARqSjykSBqKgzqlQ 1vb8IVq5T1kYACB04UrzdoamEvcE/Vq6V2nCO5ij55fZ5bmywYjwhwYExcM82ZbRYedV YXrmkBxLZXxpsIUGOrAniuOLXuqcZa8BSdUX5bdjs7ZrFjyyuxxNpX0Pveht8c6wWaiH U0XqAGLlgBT2N80KRJVkH+v4kwiHWXNsErcUuH02sFlRrIsLeIB6Vp/lYut+2oDqbbqL Y8Tg== 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=c+U4wVSOXP2kLhQz4DwH5ES5D0D8CtQVBCG5KofbJOwH+jP+GF2xVwP1SSw/77+nFO OCjzOEQS3LzFumvfG/HcwLbBNvugPxK/0E9AyBY4wduEvu6p5YgZgJFtEhCvVT+NYTj5 rkzw6rk/6WJgK5FQDSStDdDdBoZluR2ZQj5tO8LtOMiS5XEvh30oSDWryzhoIbe32FPw wEvVMYB8K9h70r4ANH+eqAKxs9RmX9cjExzv5E5Pqy/tiz7TMuIBeU55gAQXTqOfaHSd AJZINUmSrkjDyI9b+/HY8mzESSzc+TT/WErQTLIJdWfLlUaQkIL+v67yjDo0tNH6ycPe R0zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fzPgYHcc; 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 sd5-20020a1709076e0500b007330a081f1fsi8225391ejc.679.2022.08.15.13.23.18; Mon, 15 Aug 2022 13:23:47 -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=fzPgYHcc; 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 S241033AbiHOUOz (ORCPT + 99 others); Mon, 15 Aug 2022 16:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346203AbiHOULD (ORCPT ); Mon, 15 Aug 2022 16:11: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 8DDC2AE5C; Mon, 15 Aug 2022 11:57:04 -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 207DC6125B; Mon, 15 Aug 2022 18:57:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 109D4C433C1; Mon, 15 Aug 2022 18:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589823; bh=Muz+6devd5UaSOJcMQZ9LRIIl260cRIsDAwDtiF54MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fzPgYHccgP7nM9JLM5Zrzt6MYqglc3H1To23HmEZltBrWANjDAtSsMiASMVN95opi XrKAPzRjv3PQA6kbjBHvuC/Vj/BFAaQUjvnq9jj6mfUrHnzdIwbEM0l6rmsSBFU3c4 qJoGDZVmvMLCmrFpFLa7CsWojO6ZFu0T/njFDhY8= 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.18 0058/1095] parisc: Check the return value of ioremap() in lba_driver_probe() Date: Mon, 15 Aug 2022 19:50:57 +0200 Message-Id: <20220815180431.876467103@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: 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);