[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 <hidave.darkstar@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Dave Young and committed by David S. Miller 38b7da09 2072c228

+2 -9
+1 -9
net/bluetooth/hci_conn.c
··· 259 259 } 260 260 261 261 tasklet_disable(&hdev->tx_task); 262 - 263 - hci_conn_del_sysfs(conn); 264 - 265 262 hci_conn_hash_del(hdev, conn); 266 263 if (hdev->notify) 267 264 hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); 268 - 269 265 tasklet_enable(&hdev->tx_task); 270 - 271 266 skb_queue_purge(&conn->data_q); 272 - 267 + hci_conn_del_sysfs(conn); 273 268 hci_dev_put(hdev); 274 - 275 - /* will free via device release */ 276 - put_device(&conn->dev); 277 269 278 270 return 0; 279 271 }
+1
net/bluetooth/hci_sysfs.c
··· 320 320 { 321 321 struct hci_conn *conn = container_of(work, struct hci_conn, work); 322 322 device_del(&conn->dev); 323 + put_device(&conn->dev); 323 324 } 324 325 325 326 void hci_conn_del_sysfs(struct hci_conn *conn)