turnip: Fix file descriptor return.
authorVinson Lee <vlee@freedesktop.org>
Sun, 8 Nov 2020 23:59:55 +0000 (15:59 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 12 Nov 2020 22:32:23 +0000 (22:32 +0000)
Fix defect reported by Coverity Scan.

Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression -1 inside this statement: return ret ? -1 : handle.fd;

Fixes: cec0bc73e55 ("turnip: rework fences to use syncobjs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7498>

src/freedreno/vulkan/tu_drm.c

index 34b337f..a45cfcd 100644 (file)
@@ -913,8 +913,6 @@ tu_syncobj_to_fd(struct tu_device *device, struct tu_syncobj *sync)
    int ret;
 
    ret = ioctl(device->fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, &handle);
-   if (ret)
-      return 0;
 
    return ret ? -1 : handle.fd;
 }