linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] memory: pl353: Fix error return code in pl353_smc_probe()
@ 2021-05-15  4:00 Zhen Lei
  2021-05-17 11:22 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Zhen Lei @ 2021-05-15  4:00 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Michal Simek, Linus Walleij,
	Naga Sureshkumar Relli, linux-kernel
  Cc: Zhen Lei

When no child nodes are matched, an appropriate error code -ENODEV should
be returned. However, we currently do not explicitly assign this error
code to 'err'. As a result, 0 was incorrectly returned.

Fixes: fee10bd22678 ("memory: pl353: Add driver for arm pl353 static memory controller")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/memory/pl353-smc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/memory/pl353-smc.c b/drivers/memory/pl353-smc.c
index 9c0a2841677739f..b0b251bb207f3a6 100644
--- a/drivers/memory/pl353-smc.c
+++ b/drivers/memory/pl353-smc.c
@@ -407,6 +407,7 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id)
 		break;
 	}
 	if (!match) {
+		err = -ENODEV;
 		dev_err(&adev->dev, "no matching children\n");
 		goto out_clk_disable;
 	}
-- 
2.26.0.106.g9fadedd



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

* Re: [PATCH 1/1] memory: pl353: Fix error return code in pl353_smc_probe()
  2021-05-15  4:00 [PATCH 1/1] memory: pl353: Fix error return code in pl353_smc_probe() Zhen Lei
@ 2021-05-17 11:22 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2021-05-17 11:22 UTC (permalink / raw)
  To: Linus Walleij, Michal Simek, linux-kernel, Zhen Lei,
	Naga Sureshkumar Relli
  Cc: Krzysztof Kozlowski

On Sat, 15 May 2021 12:00:04 +0800, Zhen Lei wrote:
> When no child nodes are matched, an appropriate error code -ENODEV should
> be returned. However, we currently do not explicitly assign this error
> code to 'err'. As a result, 0 was incorrectly returned.

Applied, thanks!

[1/1] memory: pl353: Fix error return code in pl353_smc_probe()
      commit: 76e5624f3f9343a621dd3f4006f4e4d9c3f91e33

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

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

end of thread, other threads:[~2021-05-17 11:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-15  4:00 [PATCH 1/1] memory: pl353: Fix error return code in pl353_smc_probe() Zhen Lei
2021-05-17 11:22 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).