Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> --- drivers/net/can/c_can/c_can.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c index 606b7d8ffe13..537a2f1febdf 100644 --- a/drivers/net/can/c_can/c_can.c +++ b/drivers/net/can/c_can/c_can.c @@ -1294,9 +1294,14 @@ int register_c_can_dev(struct net_device *dev) err = register_candev(dev); if (err) - c_can_pm_runtime_disable(priv); - else - devm_can_led_init(dev); + goto register_exit_runtime_disable; + + devm_can_led_init(dev); + + return 0; + + register_exit_runtime_disable: + c_can_pm_runtime_disable(priv); return err; } -- 2.23.0