i965: Fix batch map failure check in INTEL_DEBUG=bat handling.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 19 Sep 2017 01:50:06 +0000 (18:50 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 19 Sep 2017 01:51:26 +0000 (18:51 -0700)
I originally wrote the code to call the maps 'batch' and 'state',
until I remembered that 'batch' is the intel_batchbuffer struct pointer.
The NULL check was still using the wrong variable.

Caught by Coverity.

CID: 1418109

src/mesa/drivers/dri/i965/intel_batchbuffer.c

index 7d5a8947e8f342aaaca53acc97db865d58d3ef14..6a16771fc6dbe57bfe399cbd97be7172ee5bc5ca 100644 (file)
@@ -439,7 +439,7 @@ do_batch_dump(struct brw_context *brw)
 
    uint32_t *batch_data = brw_bo_map(brw, batch->bo, MAP_READ);
    uint32_t *state = brw_bo_map(brw, batch->state_bo, MAP_READ);
-   if (batch == NULL || state == NULL) {
+   if (batch_data == NULL || state == NULL) {
       fprintf(stderr, "WARNING: failed to map batchbuffer/statebuffer\n");
       return;
    }