summaryrefslogtreecommitdiff
path: root/nouveau
diff options
context:
space:
mode:
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/nouveau_device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nouveau/nouveau_device.c b/nouveau/nouveau_device.c
index 2ffcba6f..425c5d29 100644
--- a/nouveau/nouveau_device.c
+++ b/nouveau/nouveau_device.c
@@ -46,8 +46,10 @@ nouveau_device_open_existing(struct nouveau_device **dev, int close,
nvdev->needs_close = close;
ver = drmGetVersion(fd);
- if (!ver)
+ if (!ver) {
+ nouveau_device_close((void *)&nvdev);
return -EINVAL;
+ }
if ((ver->version_major == 0 && ver->version_patchlevel != 16) ||
ver->version_major > 1) {