From: Johan Hedberg Date: Fri, 6 Nov 2015 11:35:33 +0000 (+0200) Subject: Bluetooth: Add clarifying comment why schedule_work is used X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0ebc181884e8f538c4786840ed4abef828d4dc9b;p=linux-beck.git Bluetooth: Add clarifying comment why schedule_work is used It's not obvious why schedule_work is used instead of queue_work. Add a comment explaining why. Signed-off-by: Johan Hedberg Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 85b82f7adbd2..fd6120a41138 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -178,6 +178,10 @@ static void hci_connect_le_scan_remove(struct hci_conn *conn) hci_dev_hold(conn->hdev); hci_conn_get(conn); + /* Even though we hold a reference to the hdev, many other + * things might get cleaned up meanwhile, including the hdev's + * own workqueue, so we can't use that for scheduling. + */ schedule_work(&conn->le_scan_cleanup); }