Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp46333pxb; Tue, 23 Feb 2021 17:34:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzp2ak5+tqCJW8l5/JfoYuVjZsnClJg9Yg8FFd/kfjJKJctuKDsNczFd3zZkNXCMt7m+xSs X-Received: by 2002:a17:906:82d3:: with SMTP id a19mr28501520ejy.505.1614130460995; Tue, 23 Feb 2021 17:34:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614130460; cv=none; d=google.com; s=arc-20160816; b=sjwSvhquINKM7GuGi8nR+WgppDTlj4f/PU7Evzai/hjmwE3vOiE6CGvGLL6COVVCfl SfTTG4ytZ8o1zxVx3xHt8I3UCc1nN6tqpyJfepiSZZ72mR1Dk8FeXgsLxdnybzXSHZFR 6ZJ3XdORRnjLsUXlm7Ji/sCKl2393Ei0RTUmdk5nmQbe1P6H6hVpF+kkw5xWqzDMY7j2 MxI3Zwu5W/7jqAC5MJhQNbkQdfBPhjKrsbVikFBwZxFmX8pBEvPv2KoxcbL4hNVnoM8X dDYIs62vGhN7fs01iEiApWaaDvjuarW+w16BdzZZFh48aNeIag4ZhzwZGjrJTfeOk62r 8tag== 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=gCnmPSlx/Sq8aKSRfCQAdjkFqi+b5qpdy+tDhVTNCTs=; b=opMNFHPx2iFQ5hV3aONve8kkGjm4sYFRC7uCTZ+57PWc2+HyHnXm1kUH5rHjPYcbmM 9yVrlyHU85DY6toPbWAGN0Zhc5SiZYIqCXNKjbc2UUHZ+NmhFbTAkx2iFqHp5jdvbKKp mJ+ZAT0XSmb5qWrY8x1ItMy/93w26W/7RkoF3/nCLSyQJ6H9ydFDWUC9GiVu2UZK1rBs Tw1Gsi7HaISdeHFzsty98tcKpYyxVVXMMaEVFXs7KSM9Ym3rXzQVmEQuZuqC8/akJgHj KivIF18qqoanUSsgU9cg/38MREcIoOJRCIBmJ2Ah+m/iJqIlWSlIRtM+YN/vY9hx/mxy kexg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gn41si218064ejc.544.2021.02.23.17.33.56; Tue, 23 Feb 2021 17:34:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232453AbhBXBc2 (ORCPT + 99 others); Tue, 23 Feb 2021 20:32:28 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:12644 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231414AbhBXB36 (ORCPT ); Tue, 23 Feb 2021 20:29:58 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DldZM5G9Cz16950; Wed, 24 Feb 2021 09:27:23 +0800 (CST) Received: from localhost.localdomain (10.175.102.38) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Wed, 24 Feb 2021 09:28:52 +0800 From: Wei Yongjun To: Hulk Robot , Jaroslav Kysela , "Takashi Iwai" , Lauri Kasanen , Thomas Bogendoerfer CC: Wei Yongjun , , Subject: [PATCH -next] sound: n64: Fix return value check in n64audio_probe() Date: Wed, 24 Feb 2021 01:38:03 +0000 Message-ID: <20210224013803.2146953-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.102.38] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of error, the function devm_platform_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 1448f8acf4cc ("sound: Add n64 driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- sound/mips/snd-n64.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/mips/snd-n64.c b/sound/mips/snd-n64.c index ca6b4b99da98..e35e93157755 100644 --- a/sound/mips/snd-n64.c +++ b/sound/mips/snd-n64.c @@ -312,14 +312,14 @@ static int __init n64audio_probe(struct platform_device *pdev) } priv->mi_reg_base = devm_platform_ioremap_resource(pdev, 0); - if (!priv->mi_reg_base) { - err = -EINVAL; + if (IS_ERR(priv->mi_reg_base)) { + err = PTR_ERR(priv->mi_reg_base); goto fail_dma_alloc; } priv->ai_reg_base = devm_platform_ioremap_resource(pdev, 1); - if (!priv->ai_reg_base) { - err = -EINVAL; + if (IS_ERR(priv->ai_reg_base)) { + err = PTR_ERR(priv->ai_reg_base); goto fail_dma_alloc; }