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>main
parent
c86dabfc9f
commit
c1cd3d9388
|
@ -2619,7 +2619,7 @@ int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type)
|
||||||
}
|
}
|
||||||
|
|
||||||
fd = drmOpenWithType(NULL, BusID, type);
|
fd = drmOpenWithType(NULL, BusID, type);
|
||||||
if (fd <= 0 || nr_fds == DRM_MAX_FDS)
|
if (fd < 0 || nr_fds == DRM_MAX_FDS)
|
||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
connection[nr_fds].BusID = strdup(BusID);
|
connection[nr_fds].BusID = strdup(BusID);
|
||||||
|
|
Loading…
Reference in New Issue