summaryrefslogtreecommitdiffstats
path: root/wifi/1.4
diff options
context:
space:
mode:
authorNate Jiang <qiangjiang@google.com>2020-08-26 16:38:19 -0700
committerNate Jiang <qiangjiang@google.com>2020-08-26 16:38:19 -0700
commit674b27abc31a9a06aaf661332c012eb7a33219ee (patch)
tree08d953fb9a303862a1c5112ccd0fd6d380d14d3b /wifi/1.4
parente48f75971309a19106f2d640687547264c2e08ab (diff)
downloadplatform_hardware_interfaces-674b27abc31a9a06aaf661332c012eb7a33219ee.tar.gz
platform_hardware_interfaces-674b27abc31a9a06aaf661332c012eb7a33219ee.tar.bz2
platform_hardware_interfaces-674b27abc31a9a06aaf661332c012eb7a33219ee.zip
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
Diffstat (limited to 'wifi/1.4')
-rw-r--r--wifi/1.4/default/wifi_nan_iface.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/wifi/1.4/default/wifi_nan_iface.cpp b/wifi/1.4/default/wifi_nan_iface.cpp
index 5764d35ec4..24ffb176e8 100644
--- a/wifi/1.4/default/wifi_nan_iface.cpp
+++ b/wifi/1.4/default/wifi_nan_iface.cpp
@@ -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");