Commit 146f2789 authored by Suraj Kandpal's avatar Suraj Kandpal Committed by Ville Syrjälä

drm/i915/display: Use intel_crtc_destroy_state instead kfree

intel_encoder_current_mode() seems to leak some resource because
it uses kfree instead of intel_crtc_destroy_state let us fix that.
Signed-off-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231010183101.704439-2-suraj.kandpal@intel.com
parent 2250c7ea
......@@ -3999,7 +3999,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder)
}
if (!intel_crtc_get_pipe_config(crtc_state)) {
kfree(crtc_state);
intel_crtc_destroy_state(&crtc->base, &crtc_state->uapi);
kfree(mode);
return NULL;
}
......@@ -4008,7 +4008,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder)
intel_mode_from_crtc_timings(mode, &crtc_state->hw.adjusted_mode);
kfree(crtc_state);
intel_crtc_destroy_state(&crtc->base, &crtc_state->uapi);
return mode;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment