[Mesa-dev] [PATCH] i965/miptree: Fail gracefully when make_surface returns NULL

Jason Ekstrand jason at jlekstrand.net
Wed Jan 3 21:27:22 UTC 2018


This patch looks good in isolation and you can have my rb.  However, this 
all a bit concerning and it makes me wonder if we're papering over the real 
bug.


On January 3, 2018 12:41:56 "Ian Romanick" <idr at freedesktop.org> wrote:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Every other caller of make_surface does something sensible when NULL is
> returned.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104214
> Tested-by: Cyril <cyril.duez at gmail.com>
> Cc: "17.3" <mesa-stable at lists.freedesktop.org>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index ead0c35..0079a08 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -719,6 +719,9 @@ miptree_create(struct brw_context *brw,
>           ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
>           BO_ALLOC_BUSY, 0, NULL);
>
> +      if (mt == NULL)
> +         return NULL;
> +
>        if (needs_separate_stencil(brw, mt, format) &&
>            !make_separate_stencil_surface(brw, mt)) {
>           intel_miptree_release(&mt);
> --
> 2.9.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-dev mailing list