mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
memory: pl353-smc: Fix refcount leak bug in pl353_smc_probe()
[ Upstream commit61b3c876c1
] The break of for_each_available_child_of_node() needs a corresponding of_node_put() when the reference 'child' is not used anymore. Here we do not need to call of_node_put() in fail path as '!match' means no break. While the of_platform_device_create() will created a new reference by 'child' but it has considered the refcounting. Fixes:fee10bd226
("memory: pl353: Add driver for arm pl353 static memory controller") Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220716031324.447680-1-windhl@126.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2c442b0c06
commit
fde46754d5
1 changed files with 1 additions and 0 deletions
|
@ -416,6 +416,7 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id)
|
||||||
if (init)
|
if (init)
|
||||||
init(adev, child);
|
init(adev, child);
|
||||||
of_platform_device_create(child, NULL, &adev->dev);
|
of_platform_device_create(child, NULL, &adev->dev);
|
||||||
|
of_node_put(child);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue