Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3760764rwe; Mon, 29 Aug 2022 20:06:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7mBBWKWEvfz0pdGwOT5XOKnJBtALfr//Lu2MP1SgiK8KHhUp/9X7yqOcASConNDHZikoNb X-Received: by 2002:a05:6402:2949:b0:445:dc8d:44d with SMTP id ed9-20020a056402294900b00445dc8d044dmr18850125edb.60.1661828806831; Mon, 29 Aug 2022 20:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661828806; cv=none; d=google.com; s=arc-20160816; b=EoHfrTWQ/J2cdfHipTwp2YZnHJiXjIzI3sgD3hqJwq8sy4lmZRFvQtkKEuYA+bjRsi GZf+7qLldcpG3XAEw8RX+KiD8S0iRAfA6eRDYGtVLsIg3WT23QRc9spiVzpjRcYIHt/Y 5l6PVLKaQxzz14OztdApfbtMiC0RMeHz+WxIiNfQpRPSVLlcM7tI4Ym7vj3QQaHDOIpG CvgTb/eW+ziwvOOmpCPLDtnT5WFU0EjeN+EbTmurcZ1JHvIT7x0CTAp9ehb3R6Himt2M DDE5CS/cZJVFdefFnCPnlwHh5aboQEytpUgGl/H1kg8xlDrFjAZW/wkTxq8d1N6kBG3k q6OQ== 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; bh=HOlIEl30YOdMw9DxShBbyrBOP8IWqvOZ+qz5D7uTj6A=; b=AI1WwQrsWbDvoMUnXv08tyvKQcSo8PvJUhRRcaw1jQ1scWFV14ZX0jFFP6/RzzRVKf 2nk6P4ROv9tBMomqilkQ56EG+oOJOF3vB0CG7Re1AmSabSfukrnvg3pPSjtZhT22YF0g Yixyolbr9ooBcQarvw291P8wgtnsYB/198+ipL9RfoTZYtM5bm7p6nVHEISlByDAeCjz Wc98tEqBsVv3PLBISJC4n7MoJcYp2e68GeTpmnJpAzpEX/XZWZuKikNQL/zwFZKhbsIA 3sZLjdTczdE0BofJ0Q+eDtUPJtx9Yh22c/2sgouYvWmulqdou6JDL02BJshb9prMVnrS A5vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he13-20020a1709073d8d00b00741a19c2151si2501469ejc.625.2022.08.29.20.06.22; Mon, 29 Aug 2022 20:06:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229508AbiH3DCy (ORCPT + 99 others); Mon, 29 Aug 2022 23:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230073AbiH3DCi (ORCPT ); Mon, 29 Aug 2022 23:02:38 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11287A1D6D; Mon, 29 Aug 2022 20:02:32 -0700 (PDT) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MGsSH3HYMzYcnL; Tue, 30 Aug 2022 10:58:07 +0800 (CST) Received: from kwepemm600010.china.huawei.com (7.193.23.86) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 30 Aug 2022 11:02:30 +0800 Received: from huawei.com (10.175.127.227) by kwepemm600010.china.huawei.com (7.193.23.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 30 Aug 2022 11:02:29 +0800 From: Sun Ke To: , , , CC: , , , , Subject: [PATCH] crypto: aspeed: fix return value check in aspeed_hace_probe() Date: Tue, 30 Aug 2022 11:13:47 +0800 Message-ID: <20220830031347.810217-1-sunke32@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600010.china.huawei.com (7.193.23.86) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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-crypto@vger.kernel.org In case of error, the function devm_ioremap_resource() returns ERR_PTR() not NULL. The NULL test in the return value check must be replaced with IS_ERR(). Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver") Signed-off-by: Sun Ke --- drivers/crypto/aspeed/aspeed-hace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c index 4fefc9e69d72..3f880aafb6a2 100644 --- a/drivers/crypto/aspeed/aspeed-hace.c +++ b/drivers/crypto/aspeed/aspeed-hace.c @@ -123,9 +123,9 @@ static int aspeed_hace_probe(struct platform_device *pdev) platform_set_drvdata(pdev, hace_dev); hace_dev->regs = devm_ioremap_resource(&pdev->dev, res); - if (!hace_dev->regs) { + if (IS_ERR(hace_dev->regs)) { dev_err(&pdev->dev, "Failed to map resources\n"); - return -ENOMEM; + return PTR_ERR(hace_dev->regs); } /* Get irq number and register it */ -- 2.31.1