Skip to content

Commit bcdfae5

Browse files
krzkjfvogel
authored andcommitted
can: c_can: fix unbalanced runtime PM disable in error path
commit 257a2cd 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: 6e2fe01 ("can: c_can: move runtime PM enable/disable to c_can_platform") Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://patch.msgid.link/20250112-syscon-phandle-args-can-v1-1-314d9549906f@linaro.org Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 6ea780e9a7ca57e92e820b9036aecd458cf00684) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
1 parent a085f25 commit bcdfae5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/can/c_can/c_can_platform.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,16 @@ static int c_can_plat_probe(struct platform_device *pdev)
385385
if (ret) {
386386
dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
387387
KBUILD_MODNAME, ret);
388-
goto exit_free_device;
388+
goto exit_pm_runtime;
389389
}
390390

391391
dev_info(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n",
392392
KBUILD_MODNAME, priv->base, dev->irq);
393393
return 0;
394394

395-
exit_free_device:
395+
exit_pm_runtime:
396396
pm_runtime_disable(priv->device);
397+
exit_free_device:
397398
free_c_can_dev(dev);
398399
exit:
399400
dev_err(&pdev->dev, "probe failed\n");

0 commit comments

Comments
 (0)