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: [email protected] # 5.11 Cc: Sylwester Nawrocki <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent bfe7bcd commit 3aab264

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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)