Commit 9284ab3b6e77 ("drm/i915/hdcp: check streams[] bounds before
overflow") moved the data->k bounds check in
intel_hdcp_required_content_stream() into the loop, returning -EINVAL
directly without calling drm_connector_list_iter_end() to release held
resources.

Call drm_connector_list_iter_end() before returning -EINVAL.

Fixes: 9284ab3b6e77 ("drm/i915/hdcp: check streams[] bounds before overflow")
Cc: [email protected]
Signed-off-by: Tzung-Bi Shih <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_hdcp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c 
b/drivers/gpu/drm/i915/display/intel_hdcp.c
index dad0c854e4fa..2c1ce65e7f9a 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -145,8 +145,10 @@ intel_hdcp_required_content_stream(struct 
intel_atomic_state *state,
                if (!new_conn_state || !new_conn_state->crtc)
                        continue;
 
-               if (drm_WARN_ON(display->drm, data->k >= 
INTEL_NUM_PIPES(display)))
+               if (drm_WARN_ON(display->drm, data->k >= 
INTEL_NUM_PIPES(display))) {
+                       drm_connector_list_iter_end(&conn_iter);
                        return -EINVAL;
+               }
 
                data->streams[data->k].stream_id =
                        intel_conn_to_vcpi(state, connector);
-- 
2.56.1.839.g22a8290db9-goog

Reply via email to