Re: [PATCH] interconnect: Add NULL check in exynos_generic_icc_probe

Krzysztof Kozlowski
2025-03-31T11:36:17Z

On 31/03/2025 13:08, Henry Martin wrote:
> ---
> drivers/interconnect/samsung/exynos.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/interconnect/samsung/exynos.c b/drivers/interconnect/samsung/exynos.c
> index 9e041365d909..3dccc84f72cf 100644
> --- a/drivers/interconnect/samsung/exynos.c
> +++ b/drivers/interconnect/samsung/exynos.c
> @@ -134,6 +134,8 @@ static int exynos_generic_icc_probe(struct platform_device *pdev)
> priv->node = icc_node;
> icc_node->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOFn",
> bus_dev->of_node);
> + if (!icc_node->name)
> + return -ENOMEM;

Ah, and this also leaks ICC node.

Don't create such patches in automated way, but really analyze the
entire code. You just looked at other persons' commit and decided to do
the same, but this is not correct.

Best regards,
Krzysztof