Thread (9 messages) 9 messages, 2 authors, 2025-03-30

Re: [PATCH 4/4] mfd: exynos-lpass: Fix another error handling path in exynos_lpass_probe()

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2025-03-30 10:03:56
Also in: kernel-janitors, linux-samsung-soc, lkml

On 29/03/2025 08:45, Christophe JAILLET wrote:
quoted hunk ↗ jump to hunk
 	lpass = devm_kzalloc(dev, sizeof(*lpass), GFP_KERNEL);
 	if (!lpass)
@@ -143,7 +144,15 @@ static int exynos_lpass_probe(struct platform_device *pdev)
 	pm_runtime_enable(dev);
 	exynos_lpass_enable(lpass);
 
-	return devm_of_platform_populate(dev);
+	ret = devm_of_platform_populate(dev);
+	if (ret)
+		goto err_remove_exynos_lpass;
+
+	return 0;
+
+err_remove_exynos_lpass:
+	exynos_lpass_remove(pdev);
You should have here standard unwinding, not calling remove. Or better
just convert everything to devm, because mixing devm and non-devm is
error prone.

Best regards,
Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help