summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2015-07-14 15:05:18 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2015-07-16 16:41:49 +0100
commitc1cd3d93881a9b4a27f7190393ccc7a0236d28a4 (patch)
treef10acbcc22f06cc445546666d56fb1c926d258bb
parentc86dabfc9f046e835ddbd01d28c45f9cf7c1f368 (diff)
xf86drm: fix incorrect fd comparison in drmOpenOnce{,WithType}
Spotted by looking for similar "let's assume fd == 0 is invalid" bugs. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--xf86drm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xf86drm.c b/xf86drm.c
index 2c17d116..39c6e2dc 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2619,7 +2619,7 @@ int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type)
}
fd = drmOpenWithType(NULL, BusID, type);
- if (fd <= 0 || nr_fds == DRM_MAX_FDS)
+ if (fd < 0 || nr_fds == DRM_MAX_FDS)
return fd;
connection[nr_fds].BusID = strdup(BusID);