[PATCH] phy: samsung: fix missing of_node_put()

cgel.zte@gmail.com posted 1 patch 4 years, 2 months ago
drivers/phy/samsung/phy-exynos5250-sata.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] phy: samsung: fix missing of_node_put()
Posted by cgel.zte@gmail.com 4 years, 2 months ago
From: Lv Ruyi <lv.ruyi@zte.com.cn>

of_parse_phandle returns node pointer with refcount incremented,
use of_node_put() on it when done.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/phy/samsung/phy-exynos5250-sata.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/samsung/phy-exynos5250-sata.c b/drivers/phy/samsung/phy-exynos5250-sata.c
index 9ec234243f7c..6c305a3fe187 100644
--- a/drivers/phy/samsung/phy-exynos5250-sata.c
+++ b/drivers/phy/samsung/phy-exynos5250-sata.c
@@ -187,6 +187,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	sata_phy->client = of_find_i2c_device_by_node(node);
+	of_node_put(node);
 	if (!sata_phy->client)
 		return -EPROBE_DEFER;
 
-- 
2.25.1
Re: [PATCH] phy: samsung: fix missing of_node_put()
Posted by Krzysztof Kozlowski 4 years, 2 months ago
On 07/04/2022 10:59, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> of_parse_phandle returns node pointer with refcount incremented,
> use of_node_put() on it when done.
> 

Please add fixes tag and rebase on this:
https://lore.kernel.org/all/20220309170028.51913-1-krzysztof.kozlowski@canonical.com/

I'll resend it because it might be forgotten.

> Reported-by: Zeal Robot <zealci@zte.com.cn>

I cannot find this report. This is an open source work and public
collaboration. The “Reported-by” usually means that the issue was
reported. Usually in public. Can we see the report?

> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>  drivers/phy/samsung/phy-exynos5250-sata.c | 1 +
>  1 file changed, 1 insertion(+)
> 



Best regards,
Krzysztof
Re: [PATCH] phy: samsung: fix missing of_node_put()
Posted by Krzysztof Kozlowski 4 years, 2 months ago
On 07/04/2022 10:59, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> of_parse_phandle returns node pointer with refcount incremented,
> use of_node_put() on it when done.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

Ah, now I found, that this was already fixed:
https://lore.kernel.org/all/3eed8d0c-e009-2daa-ba66-899fe8f48a90@canonical.com/


Best regards,
Krzysztof