[1/1] memory: pl353: Fix error return code in pl353_smc_probe()
diff mbox series

Message ID 20210515040004.6983-1-thunder.leizhen@huawei.com
State In Next
Commit 76e5624f3f9343a621dd3f4006f4e4d9c3f91e33
Headers show
Series
  • [1/1] memory: pl353: Fix error return code in pl353_smc_probe()
Related show

Commit Message

Leizhen (ThunderTown) May 15, 2021, 4 a.m. UTC
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(+)

Comments

Krzysztof Kozlowski May 17, 2021, 11:22 a.m. UTC | #1
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,

Patch
diff mbox series

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;
 	}