i965: check tcs for NULL dereference
Coverity issue 1361544 found an instance where the tcs variable is checked for NULL, but unconditionally dereferenced later in the same function. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -278,14 +278,16 @@ brw_codegen_tcs_prog(struct brw_context *brw,
|
|||||||
|
|
||||||
if (unlikely(brw->perf_debug)) {
|
if (unlikely(brw->perf_debug)) {
|
||||||
struct brw_shader *btcs = (struct brw_shader *) tcs;
|
struct brw_shader *btcs = (struct brw_shader *) tcs;
|
||||||
|
if (btcs) {
|
||||||
if (btcs->compiled_once) {
|
if (btcs->compiled_once) {
|
||||||
brw_tcs_debug_recompile(brw, shader_prog, key);
|
brw_tcs_debug_recompile(brw, shader_prog, key);
|
||||||
}
|
}
|
||||||
|
btcs->compiled_once = true;
|
||||||
|
}
|
||||||
if (start_busy && !drm_intel_bo_busy(brw->batch.last_bo)) {
|
if (start_busy && !drm_intel_bo_busy(brw->batch.last_bo)) {
|
||||||
perf_debug("TCS compile took %.03f ms and stalled the GPU\n",
|
perf_debug("TCS compile took %.03f ms and stalled the GPU\n",
|
||||||
(get_time() - start_time) * 1000);
|
(get_time() - start_time) * 1000);
|
||||||
}
|
}
|
||||||
btcs->compiled_once = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scratch space is used for register spilling */
|
/* Scratch space is used for register spilling */
|
||||||
|
Reference in New Issue
Block a user