From a3a73d116c1425d1d2da2f3b3aabe06a53c3d800 Mon Sep 17 00:00:00 2001 From: "Kristian H. Kristensen" Date: Tue, 14 Jan 2020 16:56:41 -0800 Subject: [PATCH] iris: Print warning and return *out = NULL when fd to syncobj fails Signed-off-by: Kristian H. Kristensen Reviewed-by: Kenneth Graunke --- src/gallium/drivers/iris/iris_fence.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.30.2