From 553ae3fbd65868a78b2b57a319a31987fe68f6be Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 3 Feb 2015 16:03:22 +1000 Subject: [PATCH] virgl/egl: check fd is valid. --- src/virgl_egl_context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/virgl_egl_context.c b/src/virgl_egl_context.c index 65c197c..8f56452 100644 --- a/src/virgl_egl_context.c +++ b/src/virgl_egl_context.c @@ -144,6 +144,8 @@ struct virgl_egl *virgl_egl_init(void) return NULL; d->fd = egl_rendernode_open(); + if (d->fd == -1) + goto fail; d->gbm_dev = gbm_create_device(d->fd); if (!d->gbm_dev) goto fail;