]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Bluetooth: hci_core: Eliminate an unnecessary goto label in hci_find_irk_by_addr()
authorZijun Hu <zijun.hu@oss.qualcomm.com>
Mon, 23 Jun 2025 12:31:18 +0000 (20:31 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 23 Jul 2025 14:26:04 +0000 (10:26 -0400)
Eliminate an unnecessary goto label by using break instead of goto to
exit the loop in hci_find_irk_by_addr().

Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_core.c

index 441cb1700f9972ad82f638c5fd551a3cff7f3c50..f2fbe9c8e1be0ddce4a68135b5bd8e0aaeb8a40c 100644 (file)
@@ -1256,12 +1256,10 @@ struct smp_irk *hci_find_irk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
                if (addr_type == irk->addr_type &&
                    bacmp(bdaddr, &irk->bdaddr) == 0) {
                        irk_to_return = irk;
-                       goto done;
+                       break;
                }
        }
 
-done:
-
        if (irk_to_return && hci_is_blocked_key(hdev, HCI_BLOCKED_KEY_TYPE_IRK,
                                                irk_to_return->val)) {
                bt_dev_warn_ratelimited(hdev, "Identity key blocked for %pMR",