mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
drm/vmwgfx: Fix oops on failing bo pin
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>
This commit is contained in:
parent
29e190e049
commit
1ef0724dbd
@ -720,6 +720,8 @@ static int vmw_surface_dmabuf_pin(struct vmw_framebuffer *vfb)
|
|||||||
&vmw_vram_ne_placement,
|
&vmw_vram_ne_placement,
|
||||||
false, &vmw_dmabuf_bo_free);
|
false, &vmw_dmabuf_bo_free);
|
||||||
vmw_overlay_resume_all(dev_priv);
|
vmw_overlay_resume_all(dev_priv);
|
||||||
|
if (unlikely(ret != 0))
|
||||||
|
vfbs->buffer = NULL;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -730,6 +732,9 @@ static int vmw_surface_dmabuf_unpin(struct vmw_framebuffer *vfb)
|
|||||||
struct vmw_framebuffer_surface *vfbs =
|
struct vmw_framebuffer_surface *vfbs =
|
||||||
vmw_framebuffer_to_vfbs(&vfb->base);
|
vmw_framebuffer_to_vfbs(&vfb->base);
|
||||||
|
|
||||||
|
if (unlikely(vfbs->buffer == NULL))
|
||||||
|
return 0;
|
||||||
|
|
||||||
bo = &vfbs->buffer->base;
|
bo = &vfbs->buffer->base;
|
||||||
ttm_bo_unref(&bo);
|
ttm_bo_unref(&bo);
|
||||||
vfbs->buffer = NULL;
|
vfbs->buffer = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user