st/nine: Remove unnecessary NULL check.
authorVinson Lee <vlee@freedesktop.org>
Tue, 27 Oct 2020 22:46:26 +0000 (15:46 -0700)
committerVinson Lee <vlee@freedesktop.org>
Sat, 7 Nov 2020 03:24:05 +0000 (19:24 -0800)
resource cannot be NULL at this point since it has already been
dereferenced earlier.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking resource suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7343>

src/gallium/frontends/nine/surface9.c

index 6e786e2..ed1be08 100644 (file)
@@ -834,8 +834,7 @@ NineSurface9_SetResourceResize( struct NineSurface9 *This,
 
     pipe_surface_reference(&This->surface[0], NULL);
     pipe_surface_reference(&This->surface[1], NULL);
-    if (resource)
-        NineSurface9_CreatePipeSurfaces(This);
+    NineSurface9_CreatePipeSurfaces(This);
 }