aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915
diff options
context:
space:
mode:
authorStéphane Marchesin <[email protected]>2013-09-06 10:55:16 -0700
committerStéphane Marchesin <[email protected]>2013-09-06 11:05:24 -0700
commit519a2cf9507275d4a3e9926072b07a3f98f0095a (patch)
tree0ce9bc8cbab83f12c3de296297a123258088648d /src/gallium/drivers/i915
parent9e14895884b129fd9e144970e705b8cb5a5f70c4 (diff)
i915g: Handle i915->batch == NULL correctly in flush
Fixes warning reported by Coverity.
Diffstat (limited to 'src/gallium/drivers/i915')
-rw-r--r--src/gallium/drivers/i915/i915_flush.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/i915/i915_flush.c b/src/gallium/drivers/i915/i915_flush.c
index 0dca722d636..8cc31a8e0c4 100644
--- a/src/gallium/drivers/i915/i915_flush.c
+++ b/src/gallium/drivers/i915/i915_flush.c
@@ -45,10 +45,13 @@ static void i915_flush_pipe( struct pipe_context *pipe,
struct i915_context *i915 = i915_context(pipe);
enum i915_winsys_flush_flags winsys_flags = I915_FLUSH_ASYNC;
+ if (!i915->batch)
+ return;
+
/* Only shortcut this if we have no fence, otherwise we must flush the
* empty batchbuffer to get our fence back.
*/
- if (!fence && i915->batch && (i915->batch->map == i915->batch->ptr)) {
+ if (!fence && (i915->batch->map == i915->batch->ptr)) {
return;
}