diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-04-05 04:16:14 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-04-06 00:19:21 -0400 |
commit | 2907e8670b6ef253bffb33bf47fd2182969cf2a0 (patch) | |
tree | 830a0ed370b23ceaf0f8529ff434dd8da570552b | |
parent | d639fbcc102745187f747a21bdcffcf628e174c8 (diff) |
drm/nouveau/kms/nv50: fix double dma_fence_put() when destroying plane state
When the atomic support was added to nouveau, the DRM core did not do this.
However, later in the same merge window, a commit (drm/fence: add in-fences
support) was merged that added it, leading to use-after-frees of the fence
object.
Cc: stable@vger.kernel.org [4.10+]
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 4405ca1fb3e2..a9182d5e6011 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -995,7 +995,6 @@ nv50_wndw_atomic_destroy_state(struct drm_plane *plane, | |||
995 | { | 995 | { |
996 | struct nv50_wndw_atom *asyw = nv50_wndw_atom(state); | 996 | struct nv50_wndw_atom *asyw = nv50_wndw_atom(state); |
997 | __drm_atomic_helper_plane_destroy_state(&asyw->state); | 997 | __drm_atomic_helper_plane_destroy_state(&asyw->state); |
998 | dma_fence_put(asyw->state.fence); | ||
999 | kfree(asyw); | 998 | kfree(asyw); |
1000 | } | 999 | } |
1001 | 1000 | ||
@@ -1007,7 +1006,6 @@ nv50_wndw_atomic_duplicate_state(struct drm_plane *plane) | |||
1007 | if (!(asyw = kmalloc(sizeof(*asyw), GFP_KERNEL))) | 1006 | if (!(asyw = kmalloc(sizeof(*asyw), GFP_KERNEL))) |
1008 | return NULL; | 1007 | return NULL; |
1009 | __drm_atomic_helper_plane_duplicate_state(plane, &asyw->state); | 1008 | __drm_atomic_helper_plane_duplicate_state(plane, &asyw->state); |
1010 | asyw->state.fence = NULL; | ||
1011 | asyw->interval = 1; | 1009 | asyw->interval = 1; |
1012 | asyw->sema = armw->sema; | 1010 | asyw->sema = armw->sema; |
1013 | asyw->ntfy = armw->ntfy; | 1011 | asyw->ntfy = armw->ntfy; |