drm/i915/display: Free crtc_state in verify_crtc_state
authorSuraj Kandpal <suraj.kandpal@intel.com>
Tue, 10 Oct 2023 05:32:09 +0000 (11:02 +0530)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 10 Oct 2023 18:43:57 +0000 (21:43 +0300)
Free hw_crtc_state in verify_crtc_state after we are done using
this or else it's just a resource leak.

Fixes: 2745bdda2095 ("drm/i915: Stop clobbering old crtc state during state check")
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231010053208.691260-1-suraj.kandpal@intel.com
drivers/gpu/drm/i915/display/intel_modeset_verify.c

index 303eb68fec11d1b64de9977239950ac6e4980510..5e1c2c7804126319f8c7740130e049812673e033 100644 (file)
@@ -214,7 +214,7 @@ verify_crtc_state(struct intel_atomic_state *state,
        }
 
        if (!sw_crtc_state->hw.active)
-               return;
+               goto destroy_state;
 
        intel_pipe_config_sanity_check(hw_crtc_state);
 
@@ -224,6 +224,9 @@ verify_crtc_state(struct intel_atomic_state *state,
                intel_crtc_state_dump(hw_crtc_state, NULL, "hw state");
                intel_crtc_state_dump(sw_crtc_state, NULL, "sw state");
        }
+
+destroy_state:
+       intel_crtc_destroy_state(&crtc->base, &hw_crtc_state->uapi);
 }
 
 void intel_modeset_verify_crtc(struct intel_atomic_state *state,