Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9088625pxu; Mon, 28 Dec 2020 06:21:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqHz2I37ngu0cA+74iq6hsef5PqzI9ndARhOM5CSl68WOZHwp5tsEm8i9Q2cJbjB9VlXAk X-Received: by 2002:a17:906:a951:: with SMTP id hh17mr29720709ejb.388.1609165273048; Mon, 28 Dec 2020 06:21:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165273; cv=none; d=google.com; s=arc-20160816; b=b8VZb496ytoNhA+1CYgbq7UDSxVFTbplY7PzhSJBC23GamW32F4zlfBxJrhcdkkF6Z LymuleSMc9Ieqc0XI7pFkIS9hGd5wzKd26K44YpfRMDLomq55o350jTZICR0ZSzVVpgQ To+ZkXHFvNJC7hHEKDNAAlQNEbLQDFfLhf97Z979uO7KDAFSQNcSeBLm+SrwWfsxlxzJ YEl+ybG4IRMlSBIHczV69uphv3ll0Q/SpKZUFoLjlIUcxe1BgMwWYFFRTog/szf1yn9m xJt0wmS3U9Jq5HEwB+yctuFR/ZCPw2eTGSkaeKSenaj2gJIddbmS7dRhPrfGPjTwd1aV 30sg== 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=CswTEyD1okIBP5VFDDJBAvpfIluN0kNlgV7U5kOiUok=; b=x4+BW3xKLyLEmDbP1P2P40PYQIWvvCDUEjhdjRi5+OBuaKCnOfDqGXmpG7M4ru2Kqc HEPAM40P5W6OeBJ2XhmVSuUV5Hp6yxgETwPZxOnG9kiRQIDUOhiGj5w8g9arA7vKxjhp G9uFrwr6vNgshTzHWwYrIZsDiqyr8tR+UqgHzx+TooX3FD5u6ppqKGE+e+mxBjqjxVp9 9Al5vvQLI3sk5euHgFXJsoPN152YyBP9uLvKijiBxZygnh326H8G4Daqn/e5e6BS0grq xkBlAlHk2kxtd5hK/HKYvGVVqEb64TCpzoxDaZEzQD0IbHr06Ga2G5+7GlU8HDPdU9LT HCMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NZ11/2cM"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt6si4280655ejb.378.2020.12.28.06.20.50; Mon, 28 Dec 2020 06:21:13 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NZ11/2cM"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502006AbgL1OSp (ORCPT + 99 others); Mon, 28 Dec 2020 09:18:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:53872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2501994AbgL1OSl (ORCPT ); Mon, 28 Dec 2020 09:18:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 75551221F0; Mon, 28 Dec 2020 14:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165080; bh=CskcqQqMF6ViCEiw1r+UT6Ii0uBwWycuPsB2aTMK1Mk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NZ11/2cMDYc7QWMTqwDbWUl0ChnqbgJ0VqMWYYMrdSkFdYFBlmjhFwOsB+DwzgqUU T5gSIA25e5zrdLVLx0LC+xeeeB33BTMvWHTL7zjlKBcadz2ZStsq5EMrjDgi68naaA gX0O38UQ7kuN8a5eLOcwaq1pDyCDHFmpDlf9AkfE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Poirier , YueHaibing , Suman Anna , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.10 403/717] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() Date: Mon, 28 Dec 2020 13:46:41 +0100 Message-Id: <20201228125040.297684913@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: YueHaibing [ Upstream commit 6dfdf6e4e7096fead7755d47d91d72e896bb4804 ] 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. Reviewed-by: Mathieu Poirier Fixes: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs") Signed-off-by: YueHaibing Acked-by: Suman Anna Link: https://lore.kernel.org/r/20200905122503.17352-1-yuehaibing@huawei.com Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- 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 9011e477290ce..863c0214e0a8e 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 -ENOMEM; } kproc->mem[i].bus_addr = res->start; kproc->mem[i].dev_addr = data->mems[i].dev_addr; -- 2.27.0