Revert "xf86drm: cap number of reported devices by drmGetDevice(2)"
This reverts commit 8cb12a2528
.
The commit fixed the OOB, yet it broke drmDevices2(0, NULL, 0) - aka we
did not return the total devices list.
Reviewed-by: Simon Ser <contact@emersion.fr>
main
parent
632f59fcbf
commit
06844b6eae
|
@ -4263,13 +4263,12 @@ drm_public int drmGetDevices2(uint32_t flags, drmDevicePtr devices[],
|
||||||
if (!local_devices[i])
|
if (!local_devices[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((devices != NULL) && (device_count < max_devices)) {
|
if ((devices != NULL) && (device_count < max_devices))
|
||||||
devices[device_count] = local_devices[i];
|
devices[device_count] = local_devices[i];
|
||||||
device_count++;
|
else
|
||||||
} else {
|
|
||||||
drmFreeDevice(&local_devices[i]);
|
drmFreeDevice(&local_devices[i]);
|
||||||
}
|
|
||||||
|
|
||||||
|
device_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
closedir(sysdir);
|
closedir(sysdir);
|
||||||
|
|
Loading…
Reference in New Issue