summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Jiang <qiangjiang@google.com>2020-08-26 16:38:19 -0700
committerArne Coucheron <arco68@gmail.com>2021-03-29 02:17:01 +0200
commit625fb9035f7656600b3901979e5d2af1b0303789 (patch)
treed29510af5c26dbd877b67dfe98c81407eb413425
parent996df86d1ab18a6120a269c50fedf9e07865f889 (diff)
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
-rw-r--r--wifi/1.0-legacy/wifi_nan_iface.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/wifi/1.0-legacy/wifi_nan_iface.cpp b/wifi/1.0-legacy/wifi_nan_iface.cpp
index 5764d35..24ffb17 100644
--- a/wifi/1.0-legacy/wifi_nan_iface.cpp
+++ b/wifi/1.0-legacy/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");