drm: xlnx: zynqmp_dpsub: fix missing clk_disable_unprepare() in error path in zynqmp_dpsub_init_clocks()
Subsystems (4)
PATCH 1/1 drm: xlnx: zynqmp_dpsub: fix missing clk_disable_unprepare() in error path in zynqmp_dpsub_init_clocks()
If get video or audio clock failed, it should call clk_disable_unprepare() in error path.
Fixes c979296ef60c ("drm: xlnx: zynqmp_dpsub: Move audio clk from zynqmp_disp to zynqmp_dpsub")
Fixes 1682ade66308 ("drm: xlnx: zynqmp_dpsub: Move pclk from zynqmp_disp to zynqmp_dpsub")
Signed-off-by Yang Yingliang <[email protected]>
--- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dpsub.c +12 -4
@@ -109,16 +109,19 @@ static int zynqmp_dpsub_init_clocks(struct zynqmp_dpsub *dpsub)* live PL video clock isn't valid. */ dpsub->vid_clk =devm_clk_get (dpsub->dev,"dp_live_video_in_clk" ); -if (!IS_ERR (dpsub->vid_clk)) +if (!IS_ERR (dpsub->vid_clk)) { dpsub->vid_clk_from_ps = false; -else if (PTR_ERR (dpsub->vid_clk) == -EPROBE_DEFER ) -return PTR_ERR (dpsub->vid_clk); + }else if (PTR_ERR (dpsub->vid_clk) == -EPROBE_DEFER ) { + ret =PTR_ERR (dpsub->vid_clk); + goto err_disable_clk; + }if (IS_ERR_OR_NULL (dpsub->vid_clk)) { dpsub->vid_clk =devm_clk_get (dpsub->dev,"dp_vtc_pixel_clk_in" );if (IS_ERR (dpsub->vid_clk)) {dev_err (dpsub->dev,"failed to init any video clock\n" ); -return PTR_ERR (dpsub->vid_clk); + ret =PTR_ERR (dpsub->vid_clk); + goto err_disable_clk; } dpsub->vid_clk_from_ps = true; }
@@ -142,6 +145,11 @@ static int zynqmp_dpsub_init_clocks(struct zynqmp_dpsub *dpsub)dev_info (dpsub->dev,"audio disabled due to missing clock\n" );return 0 ; + +err_disable_clk: +clk_disable_unprepare (dpsub->apb_clk); + +return ret; }static int zynqmp_dpsub_parse_dt (struct zynqmp_dpsub *dpsub)
Signature · 1 line
2.25.1