From: Vinson Lee Date: Sun, 22 Nov 2009 06:26:32 +0000 (-0500) Subject: svga: Prevent potential null pointer deference in vmw_surface.c. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=57d389aab5ea4462475756c0e262f3cb543f889d;p=mesa.git svga: Prevent potential null pointer deference in vmw_surface.c. --- diff --git a/src/gallium/winsys/drm/vmware/core/vmw_surface.c b/src/gallium/winsys/drm/vmware/core/vmw_surface.c index 9ec4bf92726..c19e556df9f 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_surface.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_surface.c @@ -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;