mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
can: ti_hecc: ti_hecc_probe(): add missed clk_disable_unprepare() in error path
[ Upstream commite002103b36] 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:befa60113c("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b9c4a9a07c
commit
51920ca751
@@ -936,7 +936,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;
|
||||
@@ -945,7 +945,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);
|
||||
@@ -963,7 +963,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);
|
||||
|
||||
Reference in New Issue
Block a user