Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf6f0368 authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Dave Airlie
Browse files

drm/vmwgfx: Make vmw_dmabuf_unreference handle NULL objects

parent 506ff75c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -699,11 +699,14 @@ static inline struct vmw_surface *vmw_surface_reference(struct vmw_surface *srf)
static inline void vmw_dmabuf_unreference(struct vmw_dma_buffer **buf)
{
	struct vmw_dma_buffer *tmp_buf = *buf;
	struct ttm_buffer_object *bo = &tmp_buf->base;

	*buf = NULL;
	if (tmp_buf != NULL) {
		struct ttm_buffer_object *bo = &tmp_buf->base;

		ttm_bo_unref(&bo);
	}
}

static inline struct vmw_dma_buffer *vmw_dmabuf_reference(struct vmw_dma_buffer *buf)
{