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>
main
Jonathan Gray 2016-12-17 16:09:53 +11:00 committed by Emil Velikov
parent e2e766d5ac
commit eebefaf72c
1 changed files with 2 additions and 2 deletions

View File

@ -3383,7 +3383,7 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
case DRM_BUS_PCI: case DRM_BUS_PCI:
ret = drmProcessPciDevice(&d, node, node_type, maj, min, true, flags); ret = drmProcessPciDevice(&d, node, node_type, maj, min, true, flags);
if (ret) if (ret)
goto free_devices; continue;
break; break;
default: default:
@ -3514,7 +3514,7 @@ int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices)
ret = drmProcessPciDevice(&device, node, node_type, ret = drmProcessPciDevice(&device, node, node_type,
maj, min, devices != NULL, flags); maj, min, devices != NULL, flags);
if (ret) if (ret)
goto free_devices; continue;
break; break;
default: default: