diff options
author | Dave Airlie <airlied@redhat.com> | 2016-01-21 23:56:42 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-01-21 23:56:42 +0000 |
commit | 66708981ded33478fd9c842c3c751cddf656c56e (patch) | |
tree | 243668c2678920aebb00871efe55f3d2c8a01a21 | |
parent | 7c3927ce0826ad01b544b7a21f3f6f701318f289 (diff) |
vtest: fail on renderer init failure.
This stops us crashing later due to failing to init.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | vtest/vtest_renderer.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index 6e5d9a2..2799544 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -96,9 +96,13 @@ int vtest_create_renderer(int fd, uint32_t length) renderer.remote_fd = fd; - virgl_renderer_init(&renderer, - VIRGL_RENDERER_USE_EGL | - VIRGL_RENDERER_THREAD_SYNC, &vtest_cbs); + ret = virgl_renderer_init(&renderer, + VIRGL_RENDERER_USE_EGL | + VIRGL_RENDERER_THREAD_SYNC, &vtest_cbs); + if (ret) { + fprintf(stderr, "failed to initialise renderer.\n"); + return -1; + } vtestname = malloc(length); if (!vtestname) |