Commit 9ddf32a8 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-next-fixes-2019-01-02' of...

Merge tag 'drm-misc-next-fixes-2019-01-02' of git://anongit.freedesktop.org/drm/drm-misc

 into drm-next

Fixes for v4.21:
- Fix null pointer dereference on null state pointer.
- Fix leaking damage clip when destroying plane state.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/46c4dbcd-dc23-7b46-fda9-16fe33e6ceef@linux.intel.com
parents 74136a3d c75ff001
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -241,6 +241,7 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,


	state->fence = NULL;
	state->fence = NULL;
	state->commit = NULL;
	state->commit = NULL;
	state->fb_damage_clips = NULL;
}
}
EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state);
EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state);


@@ -285,6 +286,8 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)


	if (state->commit)
	if (state->commit)
		drm_crtc_commit_put(state->commit);
		drm_crtc_commit_put(state->commit);

	drm_property_blob_put(state->fb_damage_clips);
}
}
EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state);
EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state);


+2 −1
Original line number Original line Diff line number Diff line
@@ -178,7 +178,7 @@ int drm_atomic_helper_dirtyfb(struct drm_framebuffer *fb,
	state = drm_atomic_state_alloc(fb->dev);
	state = drm_atomic_state_alloc(fb->dev);
	if (!state) {
	if (!state) {
		ret = -ENOMEM;
		ret = -ENOMEM;
		goto out;
		goto out_drop_locks;
	}
	}
	state->acquire_ctx = &ctx;
	state->acquire_ctx = &ctx;


@@ -238,6 +238,7 @@ out:
	kfree(rects);
	kfree(rects);
	drm_atomic_state_put(state);
	drm_atomic_state_put(state);


out_drop_locks:
	drm_modeset_drop_locks(&ctx);
	drm_modeset_drop_locks(&ctx);
	drm_modeset_acquire_fini(&ctx);
	drm_modeset_acquire_fini(&ctx);