From: James Park Date: Sat, 29 Aug 2020 18:35:29 +0000 (-0700) Subject: radv: Only close local_fd when valid X-Git-Tag: upstream/21.0.0~3752 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=775866478807faef626130382c86f9490e13140e;p=platform%2Fupstream%2Fmesa.git radv: Only close local_fd when valid Necessary when drm_device is bypassed. Reviewed-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index a85242a..4574465 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -466,7 +466,8 @@ radv_physical_device_destroy(struct radv_physical_device *device) radv_finish_wsi(device); device->ws->destroy(device->ws); disk_cache_destroy(device->disk_cache); - close(device->local_fd); + if (device->local_fd != -1) + close(device->local_fd); if (device->master_fd != -1) close(device->master_fd); vk_free(&device->instance->alloc, device);