Bluetooth: Fix wrong module refcount when connection setup fails
[pandora-kernel.git] / net / bluetooth / hci_conn.c
index 375f4b4..85a1c6b 100644 (file)
@@ -248,6 +248,8 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
        if (hdev->notify)
                hdev->notify(hdev, HCI_NOTIFY_CONN_ADD);
 
+       hci_conn_init_sysfs(conn);
+
        tasklet_enable(&hdev->tx_task);
 
        return conn;
@@ -290,6 +292,8 @@ int hci_conn_del(struct hci_conn *conn)
 
        hci_conn_del_sysfs(conn);
 
+       hci_dev_put(hdev);
+
        return 0;
 }