turnip: Close sync_fd only if it is a valid file descriptor.
authorVinson Lee <vlee@freedesktop.org>
Tue, 17 Nov 2020 00:23:47 +0000 (16:23 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 17 Nov 2020 01:05:44 +0000 (01:05 +0000)
commit69cad1f96ef4481cc2395def9c993ddcbb0e2540
tree0356cd2afe7cc8f510b3659f92463e39a24a22b8
parent71ee4e2853bc4af270969e6d91533cba7b9c0cb4
turnip: Close sync_fd only if it is a valid file descriptor.

Fix defects reported by Coverity Scan.

Argument cannot be negative (NEGATIVE_RETURNS)
negative_returns: sync_fd is passed to a parameter that cannot be negative.

Fixes: cec0bc73e55 ("turnip: rework fences to use syncobjs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7647>
src/freedreno/vulkan/tu_wsi_display.c