summaryrefslogtreecommitdiff
path: root/src/nouveau_dri2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nouveau_dri2.c')
-rw-r--r--src/nouveau_dri2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 6876f9c..e3445b2 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -1097,8 +1097,8 @@ static int nouveau_dri3_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD1
struct nouveau_bo *bo = nouveau_pixmap_bo(pixmap);
int fd;
- if (nouveau_bo_set_prime(bo, &fd) < 0)
- return -1;
+ if (!bo || nouveau_bo_set_prime(bo, &fd) < 0)
+ return -EINVAL;
*stride = pixmap->devKind;
*size = bo->size;