|
|
@@ -1663,7 +1663,13 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
|
|
|
kfree_skb(conn->rx_skb);
|
|
|
|
|
|
skb_queue_purge(&conn->pending_rx);
|
|
|
- flush_work(&conn->pending_rx_work);
|
|
|
+
|
|
|
+ /* We can not call flush_work(&conn->pending_rx_work) here since we
|
|
|
+ * might block if we are running on a worker from the same workqueue
|
|
|
+ * pending_rx_work is waiting on.
|
|
|
+ */
|
|
|
+ if (work_pending(&conn->pending_rx_work))
|
|
|
+ cancel_work_sync(&conn->pending_rx_work);
|
|
|
|
|
|
l2cap_unregister_all_users(conn);
|
|
|
|