OSDN Git Service

Fix hci_open_dev error check
authorJohan Hedberg <johan.hedberg@nokia.com>
Tue, 30 Jun 2009 12:59:48 +0000 (15:59 +0300)
committerJohan Hedberg <johan.hedberg@nokia.com>
Tue, 30 Jun 2009 12:59:48 +0000 (15:59 +0300)
src/security.c

index f3beadc..49957ca 100644 (file)
@@ -117,6 +117,12 @@ static void hci_req_queue_process(int dev_id)
 
        /* send the next pending cmd */
        dd = hci_open_dev(dev_id);
+       if (dd < 0) {
+               error("hci_open_dev(%d): %s (%d)", dev_id, strerror(errno),
+                                                                       errno);
+               return;
+       }
+
        do {
                struct hci_req_data *data;
                GSList *l = g_slist_find_custom(hci_req_queue, &dev_id, hci_req_find_by_devid);