diff options
author | Sergey Shtylyov <s.shtylyov@omprussia.ru> | 2020-10-07 17:54:15 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2020-11-11 12:11:03 +0100 |
commit | 3ae1dc756f48ba33428c7f958e9f19fa8244672c (patch) | |
tree | a26285dfe9e1891afceccfaff0b01ebb812118a5 /net | |
parent | Bluetooth: hci_qca: Wait for timeout during suspend (diff) | |
download | linux-3ae1dc756f48ba33428c7f958e9f19fa8244672c.tar.xz linux-3ae1dc756f48ba33428c7f958e9f19fa8244672c.zip |
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: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_event.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 17a72695865b..8281a5ce0f73 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -4936,20 +4936,15 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev, hci_dev_lock(hdev); hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); - if (!hcon) { - hci_dev_unlock(hdev); - return; - } + if (!hcon) + goto unlock; - if (!hcon->amp_mgr) { - hci_dev_unlock(hdev); - return; - } + if (!hcon->amp_mgr) + goto unlock; if (ev->status) { hci_conn_del(hcon); - hci_dev_unlock(hdev); - return; + goto unlock; } bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon; @@ -4966,6 +4961,7 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev, amp_physical_cfm(bredr_hcon, hcon); +unlock: hci_dev_unlock(hdev); } |