diff options
author | Emil Velikov <[email protected]> | 2015-11-23 20:26:59 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-11-29 14:41:00 +0000 |
commit | 5d294d9fa3dcdf8453d97f35e2c799efa887cbcc (patch) | |
tree | 774a3717907677bb06a5da2e35af137dcc23d215 /src | |
parent | 151290c1548052fa4e4d625ba99ad63919467e96 (diff) |
auxiliary/vl/dri: fd management cleanups
Analogous to previous commit, minus the extra dup. We are the one
opening the device thus we can directly use the fd.
Spotted by Coverity (CID 1339867, 1339877)
Cc: [email protected]
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_winsys_dri.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c index ae0d4cdee1b..758f50d7c23 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c @@ -392,7 +392,7 @@ vl_dri2_screen_create(Display *display, int screen) goto free_connect; if (drmGetMagic(fd, &magic)) - goto free_connect; + goto close_fd; authenticate_cookie = xcb_dri2_authenticate_unchecked(scrn->conn, get_xcb_screen(s, screen)->root, @@ -402,7 +402,7 @@ vl_dri2_screen_create(Display *display, int screen) if (authenticate == NULL || !authenticate->authenticated) goto free_authenticate; - if (pipe_loader_drm_probe_fd(&scrn->base.dev, dup(fd))) + if (pipe_loader_drm_probe_fd(&scrn->base.dev, fd)) scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev); if (!scrn->base.pscreen) @@ -428,8 +428,11 @@ vl_dri2_screen_create(Display *display, int screen) release_pipe: if (scrn->base.dev) pipe_loader_release(&scrn->base.dev, 1); + fd = -1; free_authenticate: free(authenticate); +close_fd: + close(fd); free_connect: free(connect); free_query: |