drm/etnaviv: fix NULL check before some freeing functions is not needed
authorTian Tao <tiantao6@hisilicon.com>
Mon, 25 Jan 2021 03:27:27 +0000 (11:27 +0800)
committerLucas Stach <l.stach@pengutronix.de>
Mon, 25 Jan 2021 17:29:48 +0000 (18:29 +0100)
fixed the below warning:
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c:84:2-8: WARNING: NULL check
before some freeing functions is not needed.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c

index 4aa3426..059ec31 100644 (file)
@@ -77,8 +77,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)
        /* Don't drop the pages for imported dmabuf, as they are not
         * ours, just free the array we allocated:
         */
-       if (etnaviv_obj->pages)
-               kvfree(etnaviv_obj->pages);
+       kvfree(etnaviv_obj->pages);
 
        drm_prime_gem_destroy(&etnaviv_obj->base, etnaviv_obj->sgt);
 }