summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common.c b/common.c
index 8ad0ad5..30d6017 100644
--- a/common.c
+++ b/common.c
@@ -124,7 +124,10 @@ const struct gbm * init_gbm(int drm_fd, int w, int h, uint32_t format,
uint64_t modifier, bool surfaceless)
{
gbm.dev = gbm_create_device(drm_fd);
- gbm.format = format;
+ if (!gbm.dev)
+ return NULL;
+
+ gbm.format = format;
gbm.surface = NULL;
gbm.width = w;