From: Kristian H. Kristensen Date: Wed, 15 Jan 2020 00:56:41 +0000 (-0800) Subject: iris: Print warning and return *out = NULL when fd to syncobj fails X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3a73d116c1425d1d2da2f3b3aabe06a53c3d800;p=mesa.git iris: Print warning and return *out = NULL when fd to syncobj fails Signed-off-by: Kristian H. Kristensen Reviewed-by: Kenneth Graunke --- diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c index 3de906cca29..dbd2d826588 100644 --- a/src/gallium/drivers/iris/iris_fence.c +++ b/src/gallium/drivers/iris/iris_fence.c @@ -343,7 +343,12 @@ iris_fence_create_fd(struct pipe_context *ctx, .flags = DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE, .fd = fd, }; - gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, &args); + if (gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, &args) == -1) { + fprintf(stderr, "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE failed: %s\n", + strerror(errno)); + *out = NULL; + return; + } struct iris_syncpt *syncpt = malloc(sizeof(*syncpt)); syncpt->handle = args.handle;