summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gbm/backends/dri/gbm_dri.c3
-rw-r--r--src/gbm/main/gbm.c3
2 files changed, 4 insertions, 2 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;
}
diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c
index 5a8e8b7b9f0..b9fb70d1293 100644
--- a/src/gbm/main/gbm.c
+++ b/src/gbm/main/gbm.c
@@ -204,7 +204,8 @@ gbm_bo_get_handle(struct gbm_bo *bo)
* descriptor.
* \param bo The buffer object
- * \return Returns a file descriptor referring to the underlying buffer
+ * \return Returns a file descriptor referring to the underlying buffer or -1
+ * if an error occurs.
*/
GBM_EXPORT int
gbm_bo_get_fd(struct gbm_bo *bo)