anv: Check that in_fence fd is valid before closing it.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 18 Aug 2017 19:04:55 +0000 (12:04 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 22 Aug 2017 18:56:38 +0000 (11:56 -0700)
commite29ccaac298d04ad4272af2d8b8d7a953c523e28
tree2cdc443e5ef23aeac8775944b887c3be60c8f0cd
parent7ca124a6a3987fbfc09bc530761d44714c0da773
anv: Check that in_fence fd is valid before closing it.

Probably harmless, but will overwrite errno with a failure status
code.  Reported by coverity.

CID 1416600: Argument cannot be negative (NEGATIVE_RETURNS)
Fixes: 5c4e4932e02 (anv: Implement support for exporting semaphores as FENCE_FD)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_batch_chain.c