aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Gray2016-12-16 23:09:53 -0600
committerEmil Velikov2016-12-24 11:06:58 -0600
commiteebefaf72c55fd2116f4c983ec6724a4d66ab413 (patch)
tree6ec9ec17d64c2ad008cfd032cb05a4c74b75fc98 /xf86drm.c
parente2e766d5acdbb826f1cfe5643669db54ee86f456 (diff)
downloadexternal-libdrm-eebefaf72c55fd2116f4c983ec6724a4d66ab413.tar.gz
external-libdrm-eebefaf72c55fd2116f4c983ec6724a4d66ab413.tar.xz
external-libdrm-eebefaf72c55fd2116f4c983ec6724a4d66ab413.zip
xf86drm: don't fatal on per device error in drmGetDevice[s]2
When iterating over all the device nodes if drmProcessPciDevice() returned an error for any node the function would return an error, ignoring any valid nodes. The result of this on OpenBSD where drmProcessPciDevice() results in device nodes being opened to issue ioctls to get pci data was that data obtained from /dev/drm0 would be ignored if /dev/drm1 could not be opened. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Diffstat (limited to 'xf86drm.c')
-rw-r--r--xf86drm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xf86drm.c b/xf86drm.c
index f684c017..7d7df184 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3383,7 +3383,7 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
3383 case DRM_BUS_PCI: 3383 case DRM_BUS_PCI:
3384 ret = drmProcessPciDevice(&d, node, node_type, maj, min, true, flags); 3384 ret = drmProcessPciDevice(&d, node, node_type, maj, min, true, flags);
3385 if (ret) 3385 if (ret)
3386 goto free_devices; 3386 continue;
3387 3387
3388 break; 3388 break;
3389 default: 3389 default:
@@ -3514,7 +3514,7 @@ int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices)
3514 ret = drmProcessPciDevice(&device, node, node_type, 3514 ret = drmProcessPciDevice(&device, node, node_type,
3515 maj, min, devices != NULL, flags); 3515 maj, min, devices != NULL, flags);
3516 if (ret) 3516 if (ret)
3517 goto free_devices; 3517 continue;
3518 3518
3519 break; 3519 break;
3520 default: 3520 default: