Commit 0cd63c80 authored by Dave Young's avatar Dave Young Committed by David S. Miller

bluetooth: put hci dev after del conn

Move hci_dev_put to del_conn to avoid hci dev going away before hci conn.
Signed-off-by: default avatarDave Young <hidave.darkstar@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f789c48
...@@ -260,7 +260,6 @@ int hci_conn_del(struct hci_conn *conn) ...@@ -260,7 +260,6 @@ int hci_conn_del(struct hci_conn *conn)
tasklet_enable(&hdev->tx_task); tasklet_enable(&hdev->tx_task);
skb_queue_purge(&conn->data_q); skb_queue_purge(&conn->data_q);
hci_conn_del_sysfs(conn); hci_conn_del_sysfs(conn);
hci_dev_put(hdev);
return 0; return 0;
} }
......
...@@ -334,6 +334,7 @@ static int __match_tty(struct device *dev, void *data) ...@@ -334,6 +334,7 @@ static int __match_tty(struct device *dev, void *data)
static void del_conn(struct work_struct *work) static void del_conn(struct work_struct *work)
{ {
struct hci_conn *conn = container_of(work, struct hci_conn, work); struct hci_conn *conn = container_of(work, struct hci_conn, work);
struct hci_dev *hdev = conn->hdev;
while (1) { while (1) {
struct device *dev; struct device *dev;
...@@ -344,8 +345,10 @@ static void del_conn(struct work_struct *work) ...@@ -344,8 +345,10 @@ static void del_conn(struct work_struct *work)
device_move(dev, NULL); device_move(dev, NULL);
put_device(dev); put_device(dev);
} }
device_del(&conn->dev); device_del(&conn->dev);
put_device(&conn->dev); put_device(&conn->dev);
hci_dev_put(hdev);
} }
void hci_conn_del_sysfs(struct hci_conn *conn) void hci_conn_del_sysfs(struct hci_conn *conn)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment