diff options
author | Emil Velikov <[email protected]> | 2015-11-09 11:34:48 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-11-20 10:58:44 +0000 |
commit | 6150d8d4bd64151522615c417f1fe51bff1cdd5f (patch) | |
tree | c2324a805a719191312fb29847b90d773925e6ac | |
parent | d03d9ecafa6548c30e22e26b14bf552472a9f231 (diff) |
auxiliary/vl/drm: use a label for the error path
... just like every other place in gallium.
Signed-off-by: Emil Velikov <[email protected]>
Acked-by: Alex Deucher <[email protected]>
-rw-r--r-- | src/gallium/auxiliary/vl/vl_winsys_drm.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/vl/vl_winsys_drm.c b/src/gallium/auxiliary/vl/vl_winsys_drm.c index 2ebf20c4bd3..b9efc9a901b 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_drm.c +++ b/src/gallium/auxiliary/vl/vl_winsys_drm.c @@ -49,15 +49,11 @@ vl_drm_screen_create(int fd) if (pipe_loader_drm_probe_fd(&vscreen->dev, dup(fd))) { vscreen->pscreen = pipe_loader_create_screen(vscreen->dev, PIPE_SEARCH_DIR); - if (!vscreen->pscreen) - pipe_loader_release(&vscreen->dev, 1); } #endif - if (!vscreen->pscreen) { - FREE(vscreen); - return NULL; - } + if (!vscreen->pscreen) + goto error; vscreen->destroy = vl_drm_screen_destroy; vscreen->texture_from_drawable = NULL; @@ -66,6 +62,14 @@ vl_drm_screen_create(int fd) vscreen->set_next_timestamp = NULL; vscreen->get_private = NULL; return vscreen; + +error: +#if !GALLIUM_STATIC_TARGETS + if (vscreen->dev) + pipe_loader_release(&vscreen->dev, 1); +#endif // !GALLIUM_STATIC_TARGETS + FREE(vscreen); + return NULL; } void |