st/mesa: Remove NULL check of pointer that could not be NULL.
authorVinson Lee <vlee@vmware.com>
Fri, 16 Apr 2010 07:55:35 +0000 (00:55 -0700)
committerVinson Lee <vlee@vmware.com>
Fri, 16 Apr 2010 07:55:35 +0000 (00:55 -0700)
cbuf has been dereferenced twice earlier in the same if-block. It is
either not NULL or a crash has already occurred.

src/mesa/state_tracker/st_atom_constbuf.c

index 5ac81bd4ee27e4ce04612521a5fd4b9abb312a12..a8f2b879d532c511c8d04476ac94c063532c128b 100644 (file)
@@ -84,10 +84,9 @@ void st_upload_constants( struct st_context *st,
       }
 
       /* load Mesa constants into the constant buffer */
-      if (cbuf)
-         st_no_flush_pipe_buffer_write(st, *cbuf,
-                                      0, paramBytes,
-                                      params->ParameterValues);
+      st_no_flush_pipe_buffer_write(st, *cbuf,
+                                   0, paramBytes,
+                                   params->ParameterValues);
 
       st->pipe->set_constant_buffer(st->pipe, shader_type, 0, *cbuf);
    }