From: Zhen Lei Date: Sat, 15 May 2021 04:00:04 +0000 (+0800) Subject: memory: pl353: Fix error return code in pl353_smc_probe() X-Git-Tag: v5.15~745^2~11^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76e5624f3f9343a621dd3f4006f4e4d9c3f91e33;p=platform%2Fkernel%2Flinux-starfive.git memory: pl353: Fix error return code in pl353_smc_probe() 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 Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210515040004.6983-1-thunder.leizhen@huawei.com Signed-off-by: Krzysztof Kozlowski --- diff --git a/drivers/memory/pl353-smc.c b/drivers/memory/pl353-smc.c index 9c0a284..b0b251b 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; }