Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp229536imi; Thu, 21 Jul 2022 20:20:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s/1VUbwzgPGlt4Mv1QEaRYfDAXEk1pIDPzGjX3N9IOTJ0Omj/hPfe1WJplRgPj3DPTATcd X-Received: by 2002:a17:906:5a68:b0:72b:3e88:fec1 with SMTP id my40-20020a1709065a6800b0072b3e88fec1mr1337579ejc.741.1658460027719; Thu, 21 Jul 2022 20:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658460027; cv=none; d=google.com; s=arc-20160816; b=DysBxs98CKN1aaAxoqyim3YobIn1Qa6MABioy/LG0hFBVUNmbYpDKU1W5GwPS523Uw YHuDeKCyO3SosWEiRUWZLVMQf8b0gDTGYCAzqE967UNnNWS2upZpwUZqMBIQwLZvIkbd uV/lMeqCKPwFrrgDbbVjNrYy3jocOnfKMtjKPZYE55ZJV72o4FfuuYr2XlCbL0T3OMgK +00eyVtlMia9gSWl03MNt19IcSjJdqjZU5wPVc26HJbvQZxpDvSn4ZkEMsf5h5ZkEQhM oylFOUthixNT3eLOX4CBYegY0gE8QXAMbChjnJtNBM+KNr+xABUtt9eH7Kpe1ZPWc3uC YUKA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ArhNY5OqFwWsU46FFDOGPRYRyP4YqAKWuS/CNKRF9M0=; b=I1PCJl7MonAMwVDs65GUoX9Zp1kuSrz1vu92acVGy483yYDwcfSkN9elW8KYZ7gmoE HWaJNczbkTlr8xjFbqc3U8wPiQdYl6KHPTlaehKybDsbm2NI/tK/mH3vteWnzgu0eMch rmuqA5Tzlg7TwlCX1XIrcfpIjEbr5o4mJmeLwgpNq6FSoHgTg2JJrV1ihLqDa2t6qlim LeTyQBS19IvA7D+lUgIQIIfJQ2HHlU9uVc/qBx/TaqYrGb+/IE9iPYBNZ4o5yd4rXfgW NHbgDmfpJGQc3Iiu5yrgH0PuoRQhCyNTrLADkkIQ7rs3ffcSFE71a7/zhq9z4WLinM5a aKJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=mZCb6tNB; 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=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me23-20020a170906aed700b0072b4cba9671si3955122ejb.186.2022.07.21.20.20.03; Thu, 21 Jul 2022 20:20:27 -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=@163.com header.s=s110527 header.b=mZCb6tNB; 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=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233613AbiGVC6J (ORCPT + 99 others); Thu, 21 Jul 2022 22:58:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbiGVC6B (ORCPT ); Thu, 21 Jul 2022 22:58:01 -0400 Received: from mail-m975.mail.163.com (mail-m975.mail.163.com [123.126.97.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CCDA9972D4; Thu, 21 Jul 2022 19:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=ArhNY 5OqFwWsU46FFDOGPRYRyP4YqAKWuS/CNKRF9M0=; b=mZCb6tNB2tNgmBVuV9dwD sgbtYp1XeVS/wJVJzEs1Sn10+Y/d8NX6gV+3NOoJ/LrWsnpFRprajhUzMUSYl9tl jQQjocZjG42WTCfZYxj0smm1Bu7T6RAnqyID/cnAJS4djyI9DOKZheW44lqnGZ3K l9STlVHFZ3/9RLlNSCCjPQ= Received: from localhost.localdomain (unknown [123.58.221.99]) by smtp5 (Coremail) with SMTP id HdxpCgDHJNwHEtpiy097Pg--.16585S2; Fri, 22 Jul 2022 10:57:13 +0800 (CST) From: williamsukatube@163.com To: James.Bottomley@HansenPartnership.com, deller@gmx.de, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: William Dean , Hacash Robot Subject: [PATCH] parisc: check the return value of ioremap() in lba_driver_probe() Date: Fri, 22 Jul 2022 10:57:09 +0800 Message-Id: <20220722025709.2924616-1-williamsukatube@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: HdxpCgDHJNwHEtpiy097Pg--.16585S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtFWxJr1UuFyrCw47GF1xXwb_yoWDXFb_ua y8uFWSv3yruF1xtr47W3WxZFWjyF1kuF95Wa1Utas3Gr47WF1UKrs5ury5u348urn7Ga9r GrZ5XF1jvF42yjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5Wc_DUUUUU== X-Originating-IP: [123.58.221.99] X-CM-SenderInfo: xzlozx5dpv3yxdwxuvi6rwjhhfrp/1tbiNxJGg1WBo2A1XQABse X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 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 --- drivers/parisc/lba_pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 732b516c7bf8..afc6e66ddc31 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1476,9 +1476,13 @@ lba_driver_probe(struct parisc_device *dev) 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); -- 2.25.1