From c1e79d9431735db9d1617c929cc09a761e257ce4 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 27 Oct 2018 14:28:20 -0400 Subject: [PATCH] freebsd11_network: Call probe() before attach(). See inline comment. Fixes #14611. --- src/libs/compat/freebsd11_network/driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/compat/freebsd11_network/driver.c b/src/libs/compat/freebsd11_network/driver.c index 2e231b69cd..b7d472f54f 100644 --- a/src/libs/compat/freebsd11_network/driver.c +++ b/src/libs/compat/freebsd11_network/driver.c @@ -172,7 +172,10 @@ _fbsd_init_drivers(driver_t *drivers[]) status = add_child_device(driver, root, &device); if (status != B_OK) break; - if (device_attach(device) == 0) { + // some drivers expect probe() to be called before attach() + // (i.e. they set driver softc in probe(), etc.) + if (device->methods.probe(device) >= 0 + && device_attach(device) == 0) { dprintf("%s: init_driver(%p) at %d\n", gDriverName, driver, i); status = init_root_device(&root); if (status != B_OK)