diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-11-19 05:45:02 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-11-19 05:45:02 +0000 |
commit | de352b59496db6f9ccbe6b49fe3fb5a03c912896 (patch) | |
tree | 653305323eb8afa08ef578e94dbe15748e3a4b26 /lib/libdrm/xf86drm.c | |
parent | 4ac2045a69e0e16d0a0450d556db49af2d968c54 (diff) |
Merge libdrm 2.4.73
Diffstat (limited to 'lib/libdrm/xf86drm.c')
-rw-r--r-- | lib/libdrm/xf86drm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libdrm/xf86drm.c b/lib/libdrm/xf86drm.c index 4c1f560ae..3c2c5d4b9 100644 --- a/lib/libdrm/xf86drm.c +++ b/lib/libdrm/xf86drm.c @@ -2897,7 +2897,7 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info) { #ifdef __linux__ char path[PATH_MAX + 1]; - char data[128 + 1]; + char data[512 + 1]; char *str; int domain, bus, dev, func; int fd, ret; @@ -2908,7 +2908,7 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info) return -errno; ret = read(fd, data, sizeof(data)); - data[128] = '\0'; + data[sizeof(data)-1] = '\0'; close(fd); if (ret < 0) return -errno; @@ -3182,7 +3182,6 @@ int drmGetDevice(int fd, drmDevicePtr *device) break; default: - fprintf(stderr, "The subsystem type is not supported yet\n"); continue; } @@ -3214,6 +3213,8 @@ int drmGetDevice(int fd, drmDevicePtr *device) closedir(sysdir); free(local_devices); + if (*device == NULL) + return -ENODEV; return 0; free_devices: @@ -3290,7 +3291,6 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices) break; default: - fprintf(stderr, "The subsystem type is not supported yet\n"); continue; } |