projects
/
platform
/
upstream
/
intel-gpu-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92a2f80
)
overlay: Close DRI2 device after authentication failure
author
Chris Wilson
<chris@chris-wilson.co.uk>
Thu, 22 Aug 2013 19:42:58 +0000
(20:42 +0100)
committer
Chris Wilson
<chris@chris-wilson.co.uk>
Thu, 22 Aug 2013 21:15:46 +0000
(22:15 +0100)
So that we don't leave a master fd open when operating remotely.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
overlay/x11/dri2.c
patch
|
blob
|
history
diff --git
a/overlay/x11/dri2.c
b/overlay/x11/dri2.c
index
0aa0cf5
..
6c9e90d
100644
(file)
--- a/
overlay/x11/dri2.c
+++ b/
overlay/x11/dri2.c
@@
-39,6
+39,7
@@
#include <xf86drm.h>
#include <drm.h>
#include <fcntl.h>
+#include <unistd.h>
#include "dri2.h"
@@
-160,10
+161,14
@@
int dri2_open(Display *dpy)
return -1;
if (drmIoctl(fd, DRM_IOCTL_GET_MAGIC, &auth))
-
return -1
;
+
goto err_fd
;
if (!DRI2Authenticate(dpy, DefaultRootWindow(dpy), auth.magic))
-
return -1
;
+
goto err_fd
;
return fd;
+
+err_fd:
+ close(fd);
+ return -1;
}