提交 b6852a6d 编写于 作者: F Flavio Ceolin 提交者: Mauro Carvalho Chehab

media: s5p-jpeg: Fix off-by-one problem

s5p_jpeg_runtime_resume() does not call clk_disable_unprepare()
for jpeg->clocks[0] when one of the clk_prepare_enable() fails.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NFlavio Ceolin <flavio.ceolin@intel.com>
Acked-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 3090a191
...@@ -3086,7 +3086,7 @@ static int s5p_jpeg_runtime_resume(struct device *dev) ...@@ -3086,7 +3086,7 @@ static int s5p_jpeg_runtime_resume(struct device *dev)
for (i = 0; i < jpeg->variant->num_clocks; i++) { for (i = 0; i < jpeg->variant->num_clocks; i++) {
ret = clk_prepare_enable(jpeg->clocks[i]); ret = clk_prepare_enable(jpeg->clocks[i]);
if (ret) { if (ret) {
while (--i > 0) while (--i >= 0)
clk_disable_unprepare(jpeg->clocks[i]); clk_disable_unprepare(jpeg->clocks[i]);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册