[PATCH] drm/tegra: Remove redundant null checks before kfree

From: zys . zljxml
Date: Tue Nov 29 2022 - 04:46:05 EST


From: Yushan Zhou <katrinzhou@xxxxxxxxxxx>

Fix the following coccicheck warning:
./drivers/gpu/drm/tegra/submit.c:689:2-7: WARNING:
NULL check before some freeing functions is not needed.

Signed-off-by: Yushan Zhou <katrinzhou@xxxxxxxxxxx>
---
drivers/gpu/drm/tegra/submit.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tegra/submit.c b/drivers/gpu/drm/tegra/submit.c
index b24738bdf3df..df34c5daa400 100644
--- a/drivers/gpu/drm/tegra/submit.c
+++ b/drivers/gpu/drm/tegra/submit.c
@@ -685,8 +685,7 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
kfree(job_data->used_mappings);
}

- if (job_data)
- kfree(job_data);
+ kfree(job_data);
put_bo:
gather_bo_put(&bo->base);
unlock:
--
2.27.0