Skip to content

Commit

Permalink
memory: pl353: Fix error return code in pl353_smc_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit 76e5624 ]

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: fee10bd ("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>
  • Loading branch information
Zhen Lei authored and gregkh committed Jul 20, 2021
1 parent fc7a834 commit 3199ff7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/memory/pl353-smc.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3199ff7

Please sign in to comment.