summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/drm/vmware/core/vmw_surface.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/winsys/drm/vmware/core/vmw_surface.c b/src/gallium/winsys/drm/vmware/core/vmw_surface.c
index c19e556df9f..64eb32f8b94 100644
--- a/src/gallium/winsys/drm/vmware/core/vmw_surface.c
+++ b/src/gallium/winsys/drm/vmware/core/vmw_surface.c
@@ -37,11 +37,13 @@ vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst,
{
struct pipe_reference *src_ref;
struct pipe_reference *dst_ref;
- struct vmw_svga_winsys_surface *dst = *pdst;
-
+ struct vmw_svga_winsys_surface *dst;
+
if(pdst == NULL || *pdst == src)
return;
-
+
+ dst = *pdst;
+
src_ref = src ? &src->refcnt : NULL;
dst_ref = dst ? &dst->refcnt : NULL;