i965: fix resource leak

v2: intel_miptree_release() already takes care of the planes, no need
    to hand-code the loop (Lionel)

Coverity ID: 1436909
Fixes: 3352f2d746 "i965: Create multiple miptrees for planar YUV images"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
This commit is contained in:
Eric Engestrom 2018-06-10 18:42:45 +01:00 committed by Eric Engestrom
parent 55d1a77c29
commit e43c012433
1 changed files with 3 additions and 1 deletions

View File

@ -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;