aboutsummaryrefslogtreecommitdiff
path: root/ui/egl-helpers.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-05-05 12:40:59 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-05-12 12:02:48 +0200
commit151c8e608efc29e4dde4a0dbc2e79ebbc86c319c (patch)
treeac1d6e7c95a633cf3e72113141e590864c982e8e /ui/egl-helpers.c
parente1913dbb58e7a4ab0c2dd088cc3b397b8daed8c5 (diff)
egl-helpers: add missing error check
Code didn't check for qemu_egl_init_dpy_mesa() failures, add it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170505104101.30589-5-kraxel@redhat.com
Diffstat (limited to 'ui/egl-helpers.c')
-rw-r--r--ui/egl-helpers.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
index ec2e325e21..b50225158b 100644
--- a/ui/egl-helpers.c
+++ b/ui/egl-helpers.c
@@ -80,6 +80,7 @@ static int qemu_egl_rendernode_open(const char *rendernode)
int egl_rendernode_init(const char *rendernode)
{
qemu_egl_rn_fd = -1;
+ int rc;
qemu_egl_rn_fd = qemu_egl_rendernode_open(rendernode);
if (qemu_egl_rn_fd == -1) {
@@ -93,7 +94,11 @@ int egl_rendernode_init(const char *rendernode)
goto err;
}
- qemu_egl_init_dpy_mesa((EGLNativeDisplayType)qemu_egl_rn_gbm_dev);
+ rc = qemu_egl_init_dpy_mesa((EGLNativeDisplayType)qemu_egl_rn_gbm_dev);
+ if (rc != 0) {
+ /* qemu_egl_init_dpy_mesa reports error */
+ goto err;
+ }
if (!epoxy_has_egl_extension(qemu_egl_display,
"EGL_KHR_surfaceless_context")) {