summaryrefslogtreecommitdiffstats
path: root/src/gbm/backends/dri
diff options
context:
space:
mode:
Diffstat (limited to 'src/gbm/backends/dri')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 0ab67dad210..f863616ab08 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -591,7 +591,8 @@ gbm_dri_bo_get_fd(struct gbm_bo *_bo)
if (bo->image == NULL)
return -1;
- dri->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_FD, &fd);
+ if (!dri->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_FD, &fd))
+ return -1;
return fd;
}