diff options
-rw-r--r-- | net/bluetooth/a2mp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index 42788cdbb4fe..d4946b591b71 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c | |||
@@ -278,7 +278,7 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb, | |||
278 | BT_DBG("id %d", req->id); | 278 | BT_DBG("id %d", req->id); |
279 | 279 | ||
280 | hdev = hci_dev_get(req->id); | 280 | hdev = hci_dev_get(req->id); |
281 | if (!hdev) { | 281 | if (!hdev || hdev->dev_type != HCI_AMP) { |
282 | struct a2mp_info_rsp rsp; | 282 | struct a2mp_info_rsp rsp; |
283 | 283 | ||
284 | rsp.id = req->id; | 284 | rsp.id = req->id; |
@@ -286,14 +286,16 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb, | |||
286 | 286 | ||
287 | a2mp_send(mgr, A2MP_GETINFO_RSP, hdr->ident, sizeof(rsp), | 287 | a2mp_send(mgr, A2MP_GETINFO_RSP, hdr->ident, sizeof(rsp), |
288 | &rsp); | 288 | &rsp); |
289 | } | ||
290 | 289 | ||
291 | if (hdev->dev_type != HCI_BREDR) { | 290 | goto done; |
292 | mgr->state = READ_LOC_AMP_INFO; | ||
293 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_AMP_INFO, 0, NULL); | ||
294 | } | 291 | } |
295 | 292 | ||
296 | hci_dev_put(hdev); | 293 | mgr->state = READ_LOC_AMP_INFO; |
294 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_AMP_INFO, 0, NULL); | ||
295 | |||
296 | done: | ||
297 | if (hdev) | ||
298 | hci_dev_put(hdev); | ||
297 | 299 | ||
298 | skb_pull(skb, sizeof(*req)); | 300 | skb_pull(skb, sizeof(*req)); |
299 | return 0; | 301 | return 0; |