WifiNanIface: Validate interface before cleanup.

Calling invalidate() API twice would lead to fatal error. This
commit is to check if interface isValid() before doing other operations
in invalidate() API.

Bug: 166412651
Test: atest VtsHalWifiNanV1_4TargetTest WifiNanIfaceTest
Change-Id: Ia3fc48bb3d98660705bba9a32b7a5845ff7af79f
This commit is contained in:
Nate Jiang
2020-08-26 16:38:19 -07:00
parent e48f759713
commit 674b27abc3

View File

@@ -534,6 +534,9 @@ WifiNanIface::WifiNanIface(
}
void WifiNanIface::invalidate() {
if (!isValid()) {
return;
}
// send commands to HAL to actually disable and destroy interfaces
legacy_hal_.lock()->nanDisableRequest(ifname_, 0xFFFF);
legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFE, "aware_data0");