Skip to content

Commit

Permalink
media: meson: vdec: add missing clk_disable_unprepare on error in vde…
Browse files Browse the repository at this point in the history
…c_hevc_start()

Add the missing clk_disable_unprepare() before return
from vdec_hevc_start() in the error handling case.

Fixes: 823a730 (“media: meson: vdec: add common HEVC decoder support”)
Signed-off-by: Xu Qiang <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Xu Qiang authored and mchehab committed Aug 30, 2022
1 parent 0202a66 commit 4029372
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/staging/media/meson/vdec/vdec_hevc.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@ static int vdec_hevc_start(struct amvdec_session *sess)

clk_set_rate(core->vdec_hevc_clk, 666666666);
ret = clk_prepare_enable(core->vdec_hevc_clk);
if (ret)
if (ret) {
if (core->platform->revision == VDEC_REVISION_G12A ||
core->platform->revision == VDEC_REVISION_SM1)
clk_disable_unprepare(core->vdec_hevcf_clk);
return ret;
}

if (core->platform->revision == VDEC_REVISION_SM1)
regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0,
Expand Down

0 comments on commit 4029372

Please sign in to comment.