OSDN Git Service

Fix L2cap LE crash
authorHansong Zhang <hsz@google.com>
Mon, 1 Feb 2021 22:00:11 +0000 (14:00 -0800)
committerHansong Zhang <hsz@google.com>
Tue, 2 Feb 2021 18:57:11 +0000 (10:57 -0800)
Tag: #gd-refactor
Bug: 179066870
Test: CtsVerifier
Change-Id: I61faf8aa17323b55a818eab1820d0354c84f38e9

gd/l2cap/le/internal/link_manager.cc

index e1964b4..1a4d8df 100644 (file)
@@ -130,8 +130,8 @@ void LinkManager::OnLeConnectSuccess(hci::AddressWithType connecting_address_wit
 void LinkManager::OnLeConnectFail(hci::AddressWithType address_with_type, hci::ErrorCode reason) {
   // Notify all pending links for this device
   auto pending_link = pending_links_.find(address_with_type);
-  if (pending_link == pending_links_.end() && reason != hci::ErrorCode::UNKNOWN_CONNECTION) {
-    // There is no pending link, exit; UNKNOWN_CONNECTION means we cancelled
+  if (pending_link == pending_links_.end()) {
+    // There is no pending link, exit
     LOG_INFO("Connection to %s failed without a pending link", address_with_type.ToString().c_str());
     return;
   }