提交 3aab2648 编写于 作者: J Johan Hovold 提交者: Georgi Djakov

interconnect: exynos: fix node leak in probe PM QoS error path

Make sure to add the newly allocated interconnect node to the provider
before adding the PM QoS request so that the node is freed on errors.

Fixes: 2f95b9d5 ("interconnect: Add generic interconnect driver for Exynos SoCs")
Cc: stable@vger.kernel.org      # 5.11
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: NKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: NJohan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230306075651.2449-15-johan+linaro@kernel.orgSigned-off-by: NGeorgi Djakov <djakov@kernel.org>
上级 bfe7bcd2
...@@ -149,6 +149,9 @@ static int exynos_generic_icc_probe(struct platform_device *pdev) ...@@ -149,6 +149,9 @@ static int exynos_generic_icc_probe(struct platform_device *pdev)
&priv->bus_clk_ratio)) &priv->bus_clk_ratio))
priv->bus_clk_ratio = EXYNOS_ICC_DEFAULT_BUS_CLK_RATIO; priv->bus_clk_ratio = EXYNOS_ICC_DEFAULT_BUS_CLK_RATIO;
icc_node->data = priv;
icc_node_add(icc_node, provider);
/* /*
* Register a PM QoS request for the parent (devfreq) device. * Register a PM QoS request for the parent (devfreq) device.
*/ */
...@@ -157,9 +160,6 @@ static int exynos_generic_icc_probe(struct platform_device *pdev) ...@@ -157,9 +160,6 @@ static int exynos_generic_icc_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto err_node_del; goto err_node_del;
icc_node->data = priv;
icc_node_add(icc_node, provider);
icc_parent_node = exynos_icc_get_parent(bus_dev->of_node); icc_parent_node = exynos_icc_get_parent(bus_dev->of_node);
if (IS_ERR(icc_parent_node)) { if (IS_ERR(icc_parent_node)) {
ret = PTR_ERR(icc_parent_node); ret = PTR_ERR(icc_parent_node);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册