diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2012-11-09 07:26:15 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-11-20 01:19:59 -0500 |
commit | bf6f036848ab2151c2498f11cb7d31a52a95dd5c (patch) | |
tree | b41fb38e2c78e4ad29f003f32ddfa2ad67268b71 | |
parent | 506ff75c92a44d80da96bc18d9902d29e8236fc6 (diff) |
drm/vmwgfx: Make vmw_dmabuf_unreference handle NULL objects
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 88a179e26de9..7c6f6e3a3c81 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | |||
@@ -699,10 +699,13 @@ static inline struct vmw_surface *vmw_surface_reference(struct vmw_surface *srf) | |||
699 | static inline void vmw_dmabuf_unreference(struct vmw_dma_buffer **buf) | 699 | static inline void vmw_dmabuf_unreference(struct vmw_dma_buffer **buf) |
700 | { | 700 | { |
701 | struct vmw_dma_buffer *tmp_buf = *buf; | 701 | struct vmw_dma_buffer *tmp_buf = *buf; |
702 | struct ttm_buffer_object *bo = &tmp_buf->base; | 702 | |
703 | *buf = NULL; | 703 | *buf = NULL; |
704 | if (tmp_buf != NULL) { | ||
705 | struct ttm_buffer_object *bo = &tmp_buf->base; | ||
704 | 706 | ||
705 | ttm_bo_unref(&bo); | 707 | ttm_bo_unref(&bo); |
708 | } | ||
706 | } | 709 | } |
707 | 710 | ||
708 | static inline struct vmw_dma_buffer *vmw_dmabuf_reference(struct vmw_dma_buffer *buf) | 711 | static inline struct vmw_dma_buffer *vmw_dmabuf_reference(struct vmw_dma_buffer *buf) |