If we close the fd before calling DRM_IOCTL_PRIME_FD_TO_HANDLE the kernel
will hit a -EBADF error. Move the close(fd) call to the end of
anv_CreateDmaBufImageINTEL().
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
if (result != VK_SUCCESS)
goto fail;
- close(pCreateInfo->fd);
-
image = anv_image_from_handle(image_h);
result = anv_bo_cache_import(device, &device->bo_cache,
*pMem = anv_device_memory_to_handle(mem);
*pImage = anv_image_to_handle(image);
+ close(pCreateInfo->fd);
+
return VK_SUCCESS;
fail_import: