提交 3ae1dc75 编写于 作者: S Sergey Shtylyov 提交者: Marcel Holtmann

Bluetooth: consolidate error paths in hci_phy_link_complete_evt()

hci_phy_link_complete_evt() has several duplicate error paths -- consolidate
them, using the *goto* statements.
Signed-off-by: NSergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 2be43aba
...@@ -4936,20 +4936,15 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev, ...@@ -4936,20 +4936,15 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev,
hci_dev_lock(hdev); hci_dev_lock(hdev);
hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle);
if (!hcon) { if (!hcon)
hci_dev_unlock(hdev); goto unlock;
return;
}
if (!hcon->amp_mgr) { if (!hcon->amp_mgr)
hci_dev_unlock(hdev); goto unlock;
return;
}
if (ev->status) { if (ev->status) {
hci_conn_del(hcon); hci_conn_del(hcon);
hci_dev_unlock(hdev); goto unlock;
return;
} }
bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon; bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon;
...@@ -4966,6 +4961,7 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev, ...@@ -4966,6 +4961,7 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev,
amp_physical_cfm(bredr_hcon, hcon); amp_physical_cfm(bredr_hcon, hcon);
unlock:
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册