[Lima] [PATCH] drm/lima: fix ifnullfree.cocci warnings
kbuild test robot
lkp at intel.com
Mon Feb 25 18:39:28 UTC 2019
From: kbuild test robot <lkp at intel.com>
drivers/gpu/drm/lima/lima_sched.c:35:2-20: WARNING: NULL check before some freeing functions is not needed.
drivers/gpu/drm/lima/lima_sched.c:146:2-7: WARNING: NULL check before some freeing functions is not needed.
NULL check before some freeing functions is not needed.
Based on checkpatch warning
"kfree(NULL) is safe this check is probably not required"
and kfreeaddr.cocci by Julia Lawall.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
Fixes: ef1d65006858 ("drm/lima: driver for ARM Mali4xx GPUs")
CC: Qiang Yu <yuq825 at gmail.com>
Signed-off-by: kbuild test robot <fengguang.wu at intel.com>
---
url: https://github.com/0day-ci/linux/commits/Qiang-Yu/drm-export-drm_timeout_abs_to_jiffies/20190226-010350
Please take the patch only if it's a positive warning. Thanks!
lima_sched.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/lima/lima_sched.c
+++ b/drivers/gpu/drm/lima/lima_sched.c
@@ -31,8 +31,7 @@ int lima_sched_slab_init(void)
void lima_sched_slab_fini(void)
{
- if (lima_fence_slab)
- kmem_cache_destroy(lima_fence_slab);
+ kmem_cache_destroy(lima_fence_slab);
}
static inline struct lima_fence *to_lima_fence(struct dma_fence *fence)
@@ -142,8 +141,7 @@ void lima_sched_task_fini(struct lima_sc
dma_fence_put(task->dep[i]);
}
- if (task->dep)
- kfree(task->dep);
+ kfree(task->dep);
if (task->bos) {
for (i = 0; i < task->num_bos; i++)
More information about the lima
mailing list