Skip to content

Commit 3aab264

Browse files
jhovoldGeorgi Djakov
authored andcommitted
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: 2f95b9d ("interconnect: Add generic interconnect driver for Exynos SoCs") Cc: stable@vger.kernel.org # 5.11 Cc: Sylwester Nawrocki <s.nawrocki@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230306075651.2449-15-johan+linaro@kernel.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
1 parent bfe7bcd commit 3aab264

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/interconnect/samsung/exynos.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ static int exynos_generic_icc_probe(struct platform_device *pdev)
149149
&priv->bus_clk_ratio))
150150
priv->bus_clk_ratio = EXYNOS_ICC_DEFAULT_BUS_CLK_RATIO;
151151

152+
icc_node->data = priv;
153+
icc_node_add(icc_node, provider);
154+
152155
/*
153156
* Register a PM QoS request for the parent (devfreq) device.
154157
*/
@@ -157,9 +160,6 @@ static int exynos_generic_icc_probe(struct platform_device *pdev)
157160
if (ret < 0)
158161
goto err_node_del;
159162

160-
icc_node->data = priv;
161-
icc_node_add(icc_node, provider);
162-
163163
icc_parent_node = exynos_icc_get_parent(bus_dev->of_node);
164164
if (IS_ERR(icc_parent_node)) {
165165
ret = PTR_ERR(icc_parent_node);

0 commit comments

Comments
 (0)