vfio: fix close unchecked file descriptor
authorKuba Kozak <kubax.kozak@intel.com>
Thu, 21 Sep 2017 13:49:08 +0000 (15:49 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 5 Oct 2017 21:41:42 +0000 (23:41 +0200)
commit96128b365eff2a1e5477e676c08c1fc631cc82c2
tree08c2996511ff4f56493fba40f2ee01b4becca371
parent0c57f40e66c8c29c6c92a7b0dec46fcef5584941
vfio: fix close unchecked file descriptor

Add file descriptor value check before calling close() function.

Coverity issue: 141297
Fixes: 811b6b25060f ("vfio: fix file descriptor leak in multi-process")
Cc: stable@dpdk.org
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Patrick MacArthur <patrick@patrickmacarthur.net>
lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c