[PATCH 4/4] mfd: exynos-lpass: Fix another error handling path in exynos_lpass_probe()
Krzysztof Kozlowski
krzk at kernel.org
Sun Mar 30 03:03:50 PDT 2025
On 29/03/2025 08:45, Christophe JAILLET wrote:
> 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
More information about the linux-arm-kernel
mailing list