Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp495509pxk; Wed, 2 Sep 2020 07:17:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB+taKRnA6XH6USk9TbxYd/ROvV4Tu9V5LTRUJ4PbuHOYr7C2UqZg6gKj6w5T6yCmYpPs5 X-Received: by 2002:a50:d4ce:: with SMTP id e14mr330532edj.126.1599056246003; Wed, 02 Sep 2020 07:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599056245; cv=none; d=google.com; s=arc-20160816; b=Rm4GvgkCP0RH8nLnhnPvQZMK31XVZo9zUmWtwoSa4U14aVb+A4aQAfaD9wU2KXAhKo TJupTojbURU08hvNDQKhANXtNo9zlI6RMQTORsa9vet/B+wKmJ4TQC+Xt+gAYD5Max9F dYI+X8t1HB1OpG0eFm6mZcT5AdtpVSTLfGuhAiBv76+F/wHI6UOiEzaq4sTdT1E6nxcC gKRyLJA2d6RaHWdH68m1SVrhXXewEXQT+eKlAm8FQCf4i/B75TtIKCSzYAtiNoC2ncnV FGYsE1O3O3dlst6/Ods22MLbS7kn/FgpMBJtPzW+9kI28zYHNnzzLVR+/OgX2LLVVcOw Q4PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=KmkrbpeL0zuveNmF6oDCzSCU26mhXUROfk2t0hFCdWY=; b=UrkzGZgR5Avc6v1MZ9o4DnsJrBHxTHZEZ0L15TEelntXn9zrtCSkqkgAvNofGfk3Z1 SG5OXpVfU4N4nXOOhAHV5Et22es2JtsAfNFvSoJXBLo4YAGzC2HtpKHQvc3Mtd/fbid6 Vr6RRDcr8Dx+GLeeTG5ySkE6tNvjYZY/b+5qq3emGttjk/yeBsWBgO5pWdzzCMBoRI2T yF3R0SFEET+1Y4nFWNgFWFGWrGjHVChV+d5GRWs7zVGfHHeho9hkh+Sc15mIxS39llS0 DHFl2IWk5564OPY1t6Q8NQjzNwWD8DUaLlOD/IeS+K8hSMeweIuW0qQt4/mR/b1yLPbz NqjQ== 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 o21si2552295ejg.255.2020.09.02.07.17.01; Wed, 02 Sep 2020 07:17:25 -0700 (PDT) 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 S1727883AbgIBOOT (ORCPT + 99 others); Wed, 2 Sep 2020 10:14:19 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:10799 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726521AbgIBOGs (ORCPT ); Wed, 2 Sep 2020 10:06:48 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 73C3263CD800FB392089; Wed, 2 Sep 2020 22:06:45 +0800 (CST) Received: from localhost (10.174.179.108) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Wed, 2 Sep 2020 22:06:35 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() Date: Wed, 2 Sep 2020 22:06:14 +0800 Message-ID: <20200902140614.28636-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.108] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of error, the function devm_ioremap_wc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 87218f96c21a ("remoteproc: k3-dsp: Add support for C71x DSPs") Signed-off-by: YueHaibing --- drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c index 9011e477290c..f373df35d7d0 100644 --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c @@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev, kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start, resource_size(res)); - if (IS_ERR(kproc->mem[i].cpu_addr)) { + if (!kproc->mem[i].cpu_addr) { dev_err(dev, "failed to map %s memory\n", data->mems[i].name); - return PTR_ERR(kproc->mem[i].cpu_addr); + return -EBUSY; } kproc->mem[i].bus_addr = res->start; kproc->mem[i].dev_addr = data->mems[i].dev_addr; -- 2.17.1