Re: [PATCH v2 04/10] pmdomain: samsung: plug potential memleak during probe

From: Krzysztof Kozlowski
Date: Thu Oct 09 2025 - 20:36:09 EST


On 09/10/2025 00:25, André Draszik wrote:
> of_genpd_add_provider_simple() could fail, in which case this code
> leaks the domain name, pd->pd.name.
>
> Use devm_kstrdup_const() to plug this leak. As a side-effect, we can
> simplify existing error handling.
>
> Fixes: c09a3e6c97f0 ("soc: samsung: pm_domains: Convert to regular platform driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Reviewed-by: Peter Griffin <peter.griffin@xxxxxxxxxx>
> Signed-off-by: André Draszik <andre.draszik@xxxxxxxxxx>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>

Best regards,
Krzysztof