[Mesa-dev] [PATCH mesa v2] i965: fix resource leak
Eric Engestrom
eric.engestrom at intel.com
Mon Jun 11 13:22:58 UTC 2018
From: Eric Engestrom <eric at engestrom.ch>
v2: intel_miptree_release() already takes care of the planes, no need
to hand-code the loop (Lionel)
Coverity ID: 1436909
Cc: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Fixes: 3352f2d746d3959b22ca4 "i965: Create multiple miptrees for planar YUV images"
Signed-off-by: Eric Engestrom <eric at engestrom.ch>
---
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 69024c0678bedc3a6d2c..6b89bf6848afb7c969b6 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -927,8 +927,10 @@ miptree_create_for_planar_image(struct brw_context *brw,
image->strides[index],
tiling,
MIPTREE_CREATE_NO_AUX);
- if (mt == NULL)
+ if (mt == NULL) {
+ intel_miptree_release(&planar_mt);
return NULL;
+ }
mt->target = target;
--
Cheers,
Eric
More information about the mesa-dev
mailing list