[RFC PATCH] drm/msm: Remove dead code in msm_ioctl_gem_submit()

I Hsin Cheng
2025-06-23T18:47:40Z

According to the report of Coverity Scan [1], "sync_file" is going to be
NULL when entering the "if" section after "out_post_unlock", so
"fput(sync_file->file)" is never going to be exected in this block.

[1]: https://scan5.scan.coverity.com/#/project-view/10074/10063?selectedIssue=1655089
Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
---
drivers/gpu/drm/msm/msm_gem_submit.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index d4f71bb54e84..cba1dc6fe6c6 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -904,8 +904,6 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
out_post_unlock:
if (ret && (out_fence_fd >= 0)) {
put_unused_fd(out_fence_fd);
- if (sync_file)
- fput(sync_file->file);
}

if (!IS_ERR_OR_NULL(submit)) {
--
2.43.0