Skip to content

Commit

Permalink
drm/vc4: hdmi: Add missing clk_disable_unprepare on error path
Browse files Browse the repository at this point in the history
In vc4_hdmi_encoder_pre_crtc_configure, if clk_request_start for the HSM
clock fails, we don't call clk_disable_unprepare on the pixel clock even
though it's enabled by now.

Make sure it's there to avoid leaking that reference.

Fixes: cd4cb49 ("drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate")
Signed-off-by: Maxime Ripard <[email protected]>
  • Loading branch information
mripard authored and pelwell committed Jul 2, 2021
1 parent ecdd08f commit 4afd064
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/vc4/vc4_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
vc4_hdmi->hsm_req = clk_request_start(vc4_hdmi->hsm_clock, hsm_rate);
if (IS_ERR(vc4_hdmi->hsm_req)) {
DRM_ERROR("Failed to set HSM clock rate: %ld\n", PTR_ERR(vc4_hdmi->hsm_req));
clk_disable_unprepare(vc4_hdmi->pixel_clock);
pm_runtime_put(&vc4_hdmi->pdev->dev);
return;
}
Expand Down

0 comments on commit 4afd064

Please sign in to comment.