Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 903daff6 authored by Bibby Hsieh's avatar Bibby Hsieh Committed by Sean Paul
Browse files

drm/mediatek: Use drm_atomic destroy_state helpers



Use the core destroy_state helpers to destroy core state to ensure we don't
leak if/when more fields get added later.

Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
Signed-off-by: default avatarBibby Hsieh <bibby.hsieh@mediatek.com>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1470279597-60453-5-git-send-email-bibby.hsieh@mediatek.com
parent 5bfafad8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -112,8 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
	struct mtk_crtc_state *state;

	if (crtc->state) {
		if (crtc->state->mode_blob)
			drm_property_unreference_blob(crtc->state->mode_blob);
		__drm_atomic_helper_crtc_destroy_state(crtc->state);

		state = to_mtk_crtc_state(crtc->state);
		memset(state, 0, sizeof(*state));
+1 −2
Original line number Diff line number Diff line
@@ -73,8 +73,7 @@ static void mtk_plane_reset(struct drm_plane *plane)
	struct mtk_plane_state *state;

	if (plane->state) {
		if (plane->state->fb)
			drm_framebuffer_unreference(plane->state->fb);
		__drm_atomic_helper_plane_destroy_state(plane->state);

		state = to_mtk_plane_state(plane->state);
		memset(state, 0, sizeof(*state));