Skip to content
Snippets Groups Projects
Commit 61a1a811 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Frieder Schrempf
Browse files

can: c_can: fix unbalanced runtime PM disable in error path


commit 257a2cd3eb578ee63d6bf90475dc4f4b16984139 upstream.

Runtime PM is enabled as one of the last steps of probe(), so all
earlier gotos to "exit_free_device" label were not correct and were
leading to unbalanced runtime PM disable depth.

Fixes: 6e2fe01d ("can: c_can: move runtime PM enable/disable to c_can_platform")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://patch.msgid.link/20250112-syscon-phandle-args-can-v1-1-314d9549906f@linaro.org


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c39ecc7f
No related branches found
No related tags found
1 merge request!191🤖 Sync Bot: Update v6.1-ktn to Latest Stable Kernel (v6.1.129)
...@@ -395,15 +395,16 @@ static int c_can_plat_probe(struct platform_device *pdev) ...@@ -395,15 +395,16 @@ static int c_can_plat_probe(struct platform_device *pdev)
if (ret) { if (ret) {
dev_err(&pdev->dev, "registering %s failed (err=%d)\n", dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
KBUILD_MODNAME, ret); KBUILD_MODNAME, ret);
goto exit_free_device; goto exit_pm_runtime;
} }
dev_info(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n", dev_info(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n",
KBUILD_MODNAME, priv->base, dev->irq); KBUILD_MODNAME, priv->base, dev->irq);
return 0; return 0;
exit_free_device: exit_pm_runtime:
pm_runtime_disable(priv->device); pm_runtime_disable(priv->device);
exit_free_device:
free_c_can_dev(dev); free_c_can_dev(dev);
exit: exit:
dev_err(&pdev->dev, "probe failed\n"); dev_err(&pdev->dev, "probe failed\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment