summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2021-05-15 07:00:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-20 17:10:51 +0300
commit226adc0bf9470a30ed282ad458d50bfddef5eebf (patch)
tree746fe685c027f04e643542acac2eaf090af323d8
parentb782d54b4dca0b41b87ff25197bd2344565f10e5 (diff)
downloadlinux-226adc0bf9470a30ed282ad458d50bfddef5eebf.tar.xz
memory: pl353: Fix error return code in pl353_smc_probe()
[ Upstream commit 76e5624f3f9343a621dd3f4006f4e4d9c3f91e33 ] 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> Link: https://lore.kernel.org/r/20210515040004.6983-1-thunder.leizhen@huawei.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/memory/pl353-smc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/memory/pl353-smc.c b/drivers/memory/pl353-smc.c
index b42804b1801e..cc01979780d8 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;
}