diff options
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 35083f2aa2ea..d7d96b6b1f0d 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2174,7 +2174,10 @@ static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff | |||
2174 | hci_dev_lock(hdev); | 2174 | hci_dev_lock(hdev); |
2175 | 2175 | ||
2176 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); | 2176 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); |
2177 | if (conn && conn->state == BT_CONNECTED) { | 2177 | if (!conn) |
2178 | goto unlock; | ||
2179 | |||
2180 | if (conn->state == BT_CONNECTED) { | ||
2178 | hci_conn_hold(conn); | 2181 | hci_conn_hold(conn); |
2179 | conn->disc_timeout = HCI_PAIRING_TIMEOUT; | 2182 | conn->disc_timeout = HCI_PAIRING_TIMEOUT; |
2180 | hci_conn_put(conn); | 2183 | hci_conn_put(conn); |
@@ -2194,6 +2197,7 @@ static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff | |||
2194 | mgmt_pin_code_request(hdev->id, &ev->bdaddr, secure); | 2197 | mgmt_pin_code_request(hdev->id, &ev->bdaddr, secure); |
2195 | } | 2198 | } |
2196 | 2199 | ||
2200 | unlock: | ||
2197 | hci_dev_unlock(hdev); | 2201 | hci_dev_unlock(hdev); |
2198 | } | 2202 | } |
2199 | 2203 | ||
@@ -2834,19 +2838,17 @@ unlock: | |||
2834 | static inline void hci_le_adv_report_evt(struct hci_dev *hdev, | 2838 | static inline void hci_le_adv_report_evt(struct hci_dev *hdev, |
2835 | struct sk_buff *skb) | 2839 | struct sk_buff *skb) |
2836 | { | 2840 | { |
2837 | struct hci_ev_le_advertising_info *ev; | 2841 | u8 num_reports = skb->data[0]; |
2838 | u8 num_reports; | 2842 | void *ptr = &skb->data[1]; |
2839 | |||
2840 | num_reports = skb->data[0]; | ||
2841 | ev = (void *) &skb->data[1]; | ||
2842 | 2843 | ||
2843 | hci_dev_lock(hdev); | 2844 | hci_dev_lock(hdev); |
2844 | 2845 | ||
2845 | hci_add_adv_entry(hdev, ev); | 2846 | while (num_reports--) { |
2847 | struct hci_ev_le_advertising_info *ev = ptr; | ||
2846 | 2848 | ||
2847 | while (--num_reports) { | ||
2848 | ev = (void *) (ev->data + ev->length + 1); | ||
2849 | hci_add_adv_entry(hdev, ev); | 2849 | hci_add_adv_entry(hdev, ev); |
2850 | |||
2851 | ptr += sizeof(*ev) + ev->length + 1; | ||
2850 | } | 2852 | } |
2851 | 2853 | ||
2852 | hci_dev_unlock(hdev); | 2854 | hci_dev_unlock(hdev); |