]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
interconnect: exynos: handle node name allocation failure
authorJohan Hovold <johan+linaro@kernel.org>
Mon, 23 Jun 2025 14:24:37 +0000 (16:24 +0200)
committerGeorgi Djakov <djakov@kernel.org>
Mon, 23 Jun 2025 14:59:09 +0000 (17:59 +0300)
Add the missing error handling in case node name allocation ever fails.

Fixes: 2f95b9d5cf0b ("interconnect: Add generic interconnect driver for Exynos SoCs")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20250623142437.23068-1-johan+linaro@kernel.org
Signed-off-by: Georgi Djakov <djakov@kernel.org>
drivers/interconnect/samsung/exynos.c

index 9e041365d9091be35f2bed1c7557ca60d7dba5ca..8e8f56186a3669ee834c21bb73e13eabf2cf68fa 100644 (file)
@@ -134,6 +134,11 @@ 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) {
+               icc_node_destroy(pdev->id);
+               return -ENOMEM;
+       }
+
        if (of_property_read_u32(bus_dev->of_node, "samsung,data-clock-ratio",
                                 &priv->bus_clk_ratio))
                priv->bus_clk_ratio = EXYNOS_ICC_DEFAULT_BUS_CLK_RATIO;