svga: Prevent potential null pointer deference in vmw_surface.c.
authorVinson Lee <vlee@vmware.com>
Sun, 22 Nov 2009 06:26:32 +0000 (01:26 -0500)
committerVinson Lee <vlee@vmware.com>
Sun, 22 Nov 2009 06:26:32 +0000 (01:26 -0500)
src/gallium/winsys/drm/vmware/core/vmw_surface.c

index 9ec4bf927261bd8c0e9f096b0fd451ffdc9fc4e2..c19e556df9fe47b1cbc8c5b29020443c950b4951 100644 (file)
@@ -39,7 +39,7 @@ vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst,
    struct pipe_reference *dst_ref;
    struct vmw_svga_winsys_surface *dst = *pdst;
    
-   if(*pdst == src || pdst == NULL)
+   if(pdst == NULL || *pdst == src)
       return;
    
    src_ref = src ? &src->refcnt : NULL;