From: Sergey Shtylyov Date: Wed, 7 Oct 2020 15:54:15 +0000 (+0300) Subject: Bluetooth: consolidate error paths in hci_phy_link_complete_evt() X-Git-Tag: accepted/tizen/unified/20230118.172025~8321^2~97^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ae1dc756f48ba33428c7f958e9f19fa8244672c;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 17a7269..8281a5c 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); }