Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38b7da09cfdb2202f08476d6fb22a47649a177ec
Commit:     38b7da09cfdb2202f08476d6fb22a47649a177ec
Parent:     2072c228c9a05c004a230620196da7607cdcc5b6
Author:     Dave Young <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 29 19:17:47 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Sat Dec 29 19:17:47 2007 -0800

    [BLUETOOTH]: put_device before device_del fix
    
    Because of workqueue delay, the put_device could be called before
    device_del, so move it to del_conn.
    
    Signed-off-by: Dave Young <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/bluetooth/hci_conn.c  |   10 +---------
 net/bluetooth/hci_sysfs.c |    1 +
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 9483320..34d1a3c 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -259,22 +259,14 @@ int hci_conn_del(struct hci_conn *conn)
        }
 
        tasklet_disable(&hdev->tx_task);
-
-       hci_conn_del_sysfs(conn);
-
        hci_conn_hash_del(hdev, conn);
        if (hdev->notify)
                hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);
-
        tasklet_enable(&hdev->tx_task);
-
        skb_queue_purge(&conn->data_q);
-
+       hci_conn_del_sysfs(conn);
        hci_dev_put(hdev);
 
-       /* will free via device release */
-       put_device(&conn->dev);
-
        return 0;
 }
 
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index cef1e3e..cad5103 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -320,6 +320,7 @@ static void del_conn(struct work_struct *work)
 {
        struct hci_conn *conn = container_of(work, struct hci_conn, work);
        device_del(&conn->dev);
+       put_device(&conn->dev);
 }
 
 void hci_conn_del_sysfs(struct hci_conn *conn)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to