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>
(cherry picked from commit e43c012433)
This commit is contained in:
Eric Engestrom 2018-06-10 18:42:45 +01:00 committed by Dylan Baker
parent 98dfe161b0
commit 0de0b5c406

View file

@ -915,8 +915,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;