summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2013-08-01 23:04:27 -0700
committerIan Romanick <[email protected]>2013-08-15 15:16:45 -0700
commit996bc26c873b6c992af46c9eca10bfa0f3a3b05e (patch)
tree8a8072544eb4a99d1922c4d199d5f8760578d61c
parentb055c8689eda8148ddd9a2563ee006bedd40419a (diff)
i915,i965: Fix memory leak in try_pbo_upload (v2)
Fixes "Resource leak" defect reported by Coverity. Tested on Haswell, no Piglit regressions. v2: Apply to i965, not just i915. (chadv) CC: "9.2, 9.1" <[email protected]> Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Chad Versace <[email protected]> (cherry picked from commit 035bf2198368d3fa69387788a63039d71319f0bf)
-rw-r--r--src/mesa/drivers/dri/i915/intel_tex_image.c1
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_image.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_tex_image.c b/src/mesa/drivers/dri/i915/intel_tex_image.c
index 9b1336d7593..975e77aa572 100644
--- a/src/mesa/drivers/dri/i915/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i915/intel_tex_image.c
@@ -171,6 +171,7 @@ try_pbo_upload(struct gl_context *ctx,
0, 0, false,
image->Width, image->Height, GL_COPY)) {
DBG("%s: blit failed\n", __FUNCTION__);
+ intel_miptree_release(&pbo_mt);
return false;
}
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 4b551b7c5d0..4506c3c78d8 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -173,6 +173,7 @@ try_pbo_upload(struct gl_context *ctx,
0, 0, false,
image->Width, image->Height, GL_COPY)) {
DBG("%s: blit failed\n", __FUNCTION__);
+ intel_miptree_release(&pbo_mt);
return false;
}