]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/etnaviv: Remove redundant NULL check
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Tue, 23 Mar 2021 02:46:12 +0000 (10:46 +0800)
committerLucas Stach <l.stach@pengutronix.de>
Mon, 3 May 2021 14:12:26 +0000 (16:12 +0200)
Fix the following coccicheck warnings:

./drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:622:2-8: WARNING: NULL
check before some freeing functions is not needed.

./drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:618:2-8: WARNING: NULL
check before some freeing functions is not needed.

./drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:616:2-8: WARNING: NULL
check before some freeing functions is not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c

index d05c359945799f89a946ee30d70543c2dccad00d..bd0d66ebf31461f1eead54d845e22de43a76d83e 100644 (file)
@@ -612,14 +612,10 @@ err_submit_ww_acquire:
 err_submit_cmds:
        if (ret && (out_fence_fd >= 0))
                put_unused_fd(out_fence_fd);
-       if (stream)
-               kvfree(stream);
-       if (bos)
-               kvfree(bos);
-       if (relocs)
-               kvfree(relocs);
-       if (pmrs)
-               kvfree(pmrs);
+       kvfree(stream);
+       kvfree(bos);
+       kvfree(relocs);
+       kvfree(pmrs);
 
        return ret;
 }