From c1cd3d93881a9b4a27f7190393ccc7a0236d28a4 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Tue, 14 Jul 2015 15:05:18 +0100 Subject: 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 Reviewed-by: Thierry Reding --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3