[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210409122231.8391-1-linqiheng@huawei.com>
Date: Fri, 9 Apr 2021 20:22:31 +0800
From: Qiheng Lin <linqiheng@...wei.com>
To: <l.stach@...gutronix.de>, <linux+etnaviv@...linux.org.uk>,
<christian.gmeiner@...il.com>, <airlied@...ux.ie>,
<daniel@...ll.ch>
CC: <etnaviv@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>,
<linux-kernel@...r.kernel.org>, Qiheng Lin <linqiheng@...wei.com>
Subject: [PATCH -next] drm/etnaviv: remove unneeded if-null-free check
Eliminate the following coccicheck warning:
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:616: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:620:2-8: WARNING:
NULL check before some freeing functions is not needed.
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:622:2-8: WARNING:
NULL check before some freeing functions is not needed.
Signed-off-by: Qiheng Lin <linqiheng@...wei.com>
---
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index d05c35994579..bd0d66ebf314 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -612,14 +612,10 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
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;
}
--
2.31.1
Powered by blists - more mailing lists