diff options
-rw-r--r-- | include/net/bluetooth/hci_core.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 8e103281a09b..220d8e0a75fb 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -907,11 +907,10 @@ static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, | |||
907 | 907 | ||
908 | static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type) | 908 | static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type) |
909 | { | 909 | { |
910 | u8 field_len; | 910 | size_t parsed = 0; |
911 | size_t parsed; | ||
912 | 911 | ||
913 | for (parsed = 0; parsed < data_len - 1; parsed += field_len) { | 912 | while (parsed < data_len - 1) { |
914 | field_len = data[0]; | 913 | u8 field_len = data[0]; |
915 | 914 | ||
916 | if (field_len == 0) | 915 | if (field_len == 0) |
917 | break; | 916 | break; |