From 0cd63c8089f0f6316df1393c3a93bdbc67ab314d Mon Sep 17 00:00:00 2001 From: Dave Young Date: Mon, 18 Feb 2008 20:44:01 -0800 Subject: 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: Dave Young Signed-off-by: David S. Miller --- net/bluetooth/hci_sysfs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'net/bluetooth/hci_sysfs.c') diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index f5aff6d0988a..767756c8fbcf 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c @@ -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) -- cgit v1.2.3