Skip to content

Commit

Permalink
drm/vmwgfx: Fix oops on failing bo pin
Browse files Browse the repository at this point in the history
When bo pin failed during modesetting,
vmwgfx would try to unref a non-existing buffer object.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Nov 9, 2010
1 parent 29e190e commit 1ef0724
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ static int vmw_surface_dmabuf_pin(struct vmw_framebuffer *vfb)
&vmw_vram_ne_placement,
false, &vmw_dmabuf_bo_free);
vmw_overlay_resume_all(dev_priv);
if (unlikely(ret != 0))
vfbs->buffer = NULL;

return ret;
}
Expand All @@ -730,6 +732,9 @@ static int vmw_surface_dmabuf_unpin(struct vmw_framebuffer *vfb)
struct vmw_framebuffer_surface *vfbs =
vmw_framebuffer_to_vfbs(&vfb->base);

if (unlikely(vfbs->buffer == NULL))
return 0;

bo = &vfbs->buffer->base;
ttm_bo_unref(&bo);
vfbs->buffer = NULL;
Expand Down

0 comments on commit 1ef0724

Please sign in to comment.