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

Commit 4a9341d2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth: Avoid Spurious AMP node access if not created"

parents 3feae538 55c1a3b9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4001,6 +4001,7 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev,
{
	struct hci_ev_phy_link_complete *ev = (void *) skb->data;
	struct hci_conn *hcon, *bredr_hcon;
	struct amp_mgr *mgr;

	BT_DBG("%s handle 0x%2.2x status 0x%2.2x", hdev->name, ev->phy_handle,
	       ev->status);
@@ -4019,6 +4020,14 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev,
		return;
	}

	BT_DBG("hcon %p mgr %p", hcon, hcon->amp_mgr);

	mgr = hcon->amp_mgr;
	if (!(mgr && mgr->l2cap_conn && mgr->l2cap_conn->hcon)) {
		hci_dev_unlock(hdev);
		BT_DBG("Amp Manager is not Initialized");
		return;
	}
	bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon;

	hcon->state = BT_CONNECTED;