freebsd11_network: Fix deinitialization following a failure to attach.

This fixes the KDL while loading iprowifi2100 w/o firmware installed.

Full explanation:
1) device_attach calls start_wlan
2) start_wlan fails, because lack of firmware
3) ... -> device_detach called (from device_delete_child)
4) it calls stop_wlan that faults with BAD_VALUE
5) we leave device attached... then uninit_mbufs called -> KDL

Change-Id: I18d06ea7be48e569838f17e3779d054000898043
Reviewed-on: https://review.haiku-os.org/635
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Peter Kosyh 2018-10-21 09:56:45 +03:00 committed by waddlesplash
parent 02f3646adc
commit 5483aeeb57
2 changed files with 3 additions and 3 deletions

View File

@ -471,7 +471,7 @@ device_detach(device_t device)
int result = 0;
if (HAIKU_DRIVER_REQUIRES(FBSD_WLAN_FEATURE))
result = stop_wlan(device);
if (result != 0) {
if (result != 0 && result != B_BAD_VALUE) {
atomic_or(&device->flags, DEVICE_ATTACHED);
return result;
}

View File

@ -254,9 +254,9 @@ err6:
if (HAIKU_DRIVER_REQUIRES(FBSD_TASKQUEUES))
uninit_taskqueues();
err5:
uninit_mbufs();
err4:
uninit_callout();
err4:
uninit_mbufs();
err3:
uninit_mutexes();
err2: