Hello, Joan Lledó via Bug reports for the GNU Hurd, le dim. 03 nov. 2019 11:00:56 +0100, a ecrit: > + devices = realloc(pci_sys->devices, (pci_sys->num_devices + 1) > + * sizeof(struct pci_device_private));
Yes, this looks like a simpler approach. Sure realloc() has some cost, but that's not much compared to the RPCs etc. and we do that at initialization only. > + if (!devices) > + return ENOMEM; That makes me realize: we need to closedir(dir). > if (err) { > - mach_port_deallocate (mach_task_self (), pci_server_port); > - /* Fall back to x86 access method */ > - return pci_system_x86_create(); > + /* There was an error, but we don't know which devices have been > + * initialized correctly, so call cleanup to free whatever is > allocated */ > + pci_system_cleanup(); > + return err; We also need to call x86_disable_io(); Also, don't wee need to keep a way to fallback to the x86 access method? Otherwise how does the pciarbiter manage to trigger calling the x86 access method? Samuel