All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remoteproc: k3-dsp: Fix return value check in devm_ioremap_uc()
@ 2020-11-13  7:08 Wang Li
  2020-11-16 17:06 ` Suman Anna
  2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Li @ 2020-11-13  7:08 UTC (permalink / raw)
  To: ohad, bjorn.andersson, mathieu.poirier, s-anna; +Cc: linux-remoteproc, wangli74

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: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Li <wangli74@huawei.com>
---
 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..863c0214e0a8 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.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] remoteproc: k3-dsp: Fix return value check in devm_ioremap_uc()
  2020-11-13  7:08 [PATCH] remoteproc: k3-dsp: Fix return value check in devm_ioremap_uc() Wang Li
@ 2020-11-16 17:06 ` Suman Anna
  2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
  1 sibling, 0 replies; 3+ messages in thread
From: Suman Anna @ 2020-11-16 17:06 UTC (permalink / raw)
  To: Wang Li, ohad, bjorn.andersson, mathieu.poirier; +Cc: linux-remoteproc

Hi Wang,

On 11/13/20 1:08 AM, Wang Li wrote:
> 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: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Li <wangli74@huawei.com>

Hmm, a patch was already posted for this previously, looks like it got missed
somehow.

https://patchwork.kernel.org/project/linux-remoteproc/patch/20200905122503.17352-1-yuehaibing@huawei.com/

Bjorn,
Can you pick up the previous patch that was already acked by me and Mathieu?
Appreciate it if you can include it in your fixes branch for 5.10 itself.

regards
Suman

> ---
>  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..863c0214e0a8 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;
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] remoteproc: k3-dsp: Fix return value check in devm_ioremap_uc()
  2020-11-13  7:08 [PATCH] remoteproc: k3-dsp: Fix return value check in devm_ioremap_uc() Wang Li
  2020-11-16 17:06 ` Suman Anna
@ 2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2020-11-18 14:30 UTC (permalink / raw)
  To: Wang Li; +Cc: linux-remoteproc

Hello:

This patch was applied to andersson/remoteproc.git (refs/heads/for-next):

On Fri, 13 Nov 2020 15:08:40 +0800 you wrote:
> 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: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Li <wangli74@huawei.com>
> 
> [...]

Here is the summary with links:
  - remoteproc: k3-dsp: Fix return value check in devm_ioremap_uc()
    https://git.kernel.org/andersson/remoteproc/c/9b3b3c9531e8

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-18 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  7:08 [PATCH] remoteproc: k3-dsp: Fix return value check in devm_ioremap_uc() Wang Li
2020-11-16 17:06 ` Suman Anna
2020-11-18 14:30 ` patchwork-bot+linux-remoteproc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.