提交 28d42d2f 编写于 作者: S Sakari Ailus 提交者: Mauro Carvalho Chehab

media: cadence: csi2rx: Fix csi2rx_start error handling

The clocks enabled by csi2rx_start function are intended to be disabled in
an error path but there are two issues:

1) the loop condition is always true and

2) the first clock disabled is the the one enabling of which failed.

Fix these two bugs by changing the loop condition as well as only disabling
the clocks that were actually enabled.
Reported-by: NMauro Chehab <mchehab@kernel.org>
Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: NMaxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 844ef042
......@@ -174,8 +174,8 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx)
return 0;
err_disable_pixclk:
for (; i >= 0; i--)
clk_disable_unprepare(csi2rx->pixel_clk[i]);
for (; i > 0; i--)
clk_disable_unprepare(csi2rx->pixel_clk[i - 1]);
err_disable_pclk:
clk_disable_unprepare(csi2rx->p_clk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册