Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 674b27ab authored by Nate Jiang's avatar Nate Jiang
Browse files

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
parent e48f7597
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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");