Skip to content

Commit

Permalink
can: ti_hecc: ti_hecc_probe(): add missed clk_disable_unprepare() in …
Browse files Browse the repository at this point in the history
…error path

[ Upstream commit e002103 ]

The driver forgets to call clk_disable_unprepare() in error path after
a success calling for clk_prepare_enable().

Fix it by adding a clk_disable_unprepare() in error path.

Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1594973079-27743-1-git-send-email-zhangchangzhong@huawei.com
Fixes: befa601 ("can: ti_hecc: add missing prepare and unprepare of the clock")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Zhang Changzhong authored and gregkh committed Nov 18, 2020
1 parent f43d555 commit 156a84f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/can/ti_hecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ static int ti_hecc_probe(struct platform_device *pdev)
err = clk_prepare_enable(priv->clk);
if (err) {
dev_err(&pdev->dev, "clk_prepare_enable() failed\n");
goto probe_exit_clk;
goto probe_exit_release_clk;
}

priv->offload.mailbox_read = ti_hecc_mailbox_read;
Expand All @@ -959,7 +959,7 @@ static int ti_hecc_probe(struct platform_device *pdev)
err = can_rx_offload_add_timestamp(ndev, &priv->offload);
if (err) {
dev_err(&pdev->dev, "can_rx_offload_add_timestamp() failed\n");
goto probe_exit_clk;
goto probe_exit_disable_clk;
}

err = register_candev(ndev);
Expand All @@ -977,7 +977,9 @@ static int ti_hecc_probe(struct platform_device *pdev)

probe_exit_offload:
can_rx_offload_del(&priv->offload);
probe_exit_clk:
probe_exit_disable_clk:
clk_disable_unprepare(priv->clk);
probe_exit_release_clk:
clk_put(priv->clk);
probe_exit_candev:
free_candev(ndev);
Expand Down

0 comments on commit 156a84f

Please sign in to comment.