summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xf86drm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xf86drm.c b/xf86drm.c
index 9cfca49d..9b52889e 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
closedir(sysdir);
free(local_devices);
+ if (*device == NULL)
+ return -ENODEV;
return 0;
free_devices: