diff options
author | Dave Airlie <airlied@redhat.com> | 2019-01-03 23:09:12 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2019-01-03 23:09:15 -0500 |
commit | 9ddf32a8df9e342371aaf9233d59739a356231e6 (patch) | |
tree | bb1673a277628d7281c47dfbfc0418ebb232c905 | |
parent | 74136a3d47f51ae72ee8b9ebc1ec2a29bcf30676 (diff) | |
parent | c75ff001f4fe21a8c9f15aad799a8949aea109f7 (diff) |
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: Dave 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
-rw-r--r-- | drivers/gpu/drm/drm_atomic_state_helper.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_damage_helper.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c index 60bd7d708e35..4985384e51f6 100644 --- a/drivers/gpu/drm/drm_atomic_state_helper.c +++ b/drivers/gpu/drm/drm_atomic_state_helper.c | |||
@@ -241,6 +241,7 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, | |||
241 | 241 | ||
242 | state->fence = NULL; | 242 | state->fence = NULL; |
243 | state->commit = NULL; | 243 | state->commit = NULL; |
244 | state->fb_damage_clips = NULL; | ||
244 | } | 245 | } |
245 | EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state); | 246 | EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state); |
246 | 247 | ||
@@ -285,6 +286,8 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state) | |||
285 | 286 | ||
286 | if (state->commit) | 287 | if (state->commit) |
287 | drm_crtc_commit_put(state->commit); | 288 | drm_crtc_commit_put(state->commit); |
289 | |||
290 | drm_property_blob_put(state->fb_damage_clips); | ||
288 | } | 291 | } |
289 | EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state); | 292 | EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state); |
290 | 293 | ||
diff --git a/drivers/gpu/drm/drm_damage_helper.c b/drivers/gpu/drm/drm_damage_helper.c index d2a1c7372f36..31032407254d 100644 --- a/drivers/gpu/drm/drm_damage_helper.c +++ b/drivers/gpu/drm/drm_damage_helper.c | |||
@@ -178,7 +178,7 @@ int drm_atomic_helper_dirtyfb(struct drm_framebuffer *fb, | |||
178 | state = drm_atomic_state_alloc(fb->dev); | 178 | state = drm_atomic_state_alloc(fb->dev); |
179 | if (!state) { | 179 | if (!state) { |
180 | ret = -ENOMEM; | 180 | ret = -ENOMEM; |
181 | goto out; | 181 | goto out_drop_locks; |
182 | } | 182 | } |
183 | state->acquire_ctx = &ctx; | 183 | state->acquire_ctx = &ctx; |
184 | 184 | ||
@@ -238,6 +238,7 @@ out: | |||
238 | kfree(rects); | 238 | kfree(rects); |
239 | drm_atomic_state_put(state); | 239 | drm_atomic_state_put(state); |
240 | 240 | ||
241 | out_drop_locks: | ||
241 | drm_modeset_drop_locks(&ctx); | 242 | drm_modeset_drop_locks(&ctx); |
242 | drm_modeset_acquire_fini(&ctx); | 243 | drm_modeset_acquire_fini(&ctx); |
243 | 244 | ||