]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
bluetooth: put hci dev after del conn
authorDave Young <hidave.darkstar@gmail.com>
Tue, 19 Feb 2008 04:44:01 +0000 (20:44 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Feb 2008 04:44:01 +0000 (20:44 -0800)
Move hci_dev_put to del_conn to avoid hci dev going away before hci conn.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bluetooth/hci_conn.c
net/bluetooth/hci_sysfs.c

index 5fc7be206f629972ea32543079a7972bd02bd156..f8880261da0e2d115a54526fe4a3625bf82fae08 100644 (file)
@@ -260,7 +260,6 @@ int hci_conn_del(struct hci_conn *conn)
        tasklet_enable(&hdev->tx_task);
        skb_queue_purge(&conn->data_q);
        hci_conn_del_sysfs(conn);
-       hci_dev_put(hdev);
 
        return 0;
 }
index f5aff6d0988a401c9eaa9ff8d6ec6d7b930f7b11..767756c8fbcf3b0dfdcfde0a512d11def584a3f7 100644 (file)
@@ -334,6 +334,7 @@ static int __match_tty(struct device *dev, void *data)
 static void del_conn(struct work_struct *work)
 {
        struct hci_conn *conn = container_of(work, struct hci_conn, work);
+       struct hci_dev *hdev = conn->hdev;
 
        while (1) {
                struct device *dev;
@@ -344,8 +345,10 @@ static void del_conn(struct work_struct *work)
                device_move(dev, NULL);
                put_device(dev);
        }
+
        device_del(&conn->dev);
        put_device(&conn->dev);
+       hci_dev_put(hdev);
 }
 
 void hci_conn_del_sysfs(struct hci_conn *conn)