From: Topi Pohjolainen Date: Tue, 20 Jun 2017 14:36:46 +0000 (+0300) Subject: i965/miptree: Check for miptree_create() failures X-Git-Tag: upstream/18.1.0~7715 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2309363868aaf5821b748042e34b5c827e6cfb00;p=platform%2Fupstream%2Fmesa.git i965/miptree: Check for miptree_create() failures Rest of the function assumes it always succeeds. Reviewed-by: Jason Ekstrand Signed-off-by: Topi Pohjolainen --- diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index f48d834..da454ad 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -889,6 +889,8 @@ intel_miptree_create(struct brw_context *brw, first_level, last_level, width0, height0, depth0, num_samples, layout_flags); + if (!mt) + return NULL; /* If the BO is too large to fit in the aperture, we need to use the * BLT engine to support it. Prior to Sandybridge, the BLT paths can't