[Mesa-dev] [PATCH] i965: Don't bother freeing NULL.

Jason Ekstrand jason at jlekstrand.net
Sat Apr 11 11:10:58 PDT 2015


On Sat, Apr 11, 2015 at 10:23 AM, Matt Turner <mattst88 at gmail.com> wrote:
> Commit e16c5c90 was replacing 'region' with 'mt', leaving this
> nonsensical code.
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index eb226d5..540f015 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -725,10 +725,8 @@ intel_miptree_create_for_bo(struct brw_context *brw,
>                                      0, 0,
>                                      width, height, depth,
>                                      true, 0, false);
> -   if (!mt) {
> -      free(mt);
> -      return mt;
> -   }
> +   if (!mt)
> +      return NULL;

Wow!  That's quite a find.

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

>     drm_intel_bo_reference(bo);
>     mt->bo = bo;
> --
> 2.0.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list