Bluetooth: Avoid a case where sleep is getting called in soft irq context
While turning off BT, sleep is getting called in the soft isr context
from work queue which is queued from a code section guarded under the
bh lock,
To resolve this released the bh lock before queing the work, as it wont
impact any BT functionality.
CRs-fixed: 405917
Change-Id: I1b872d724b4d0d384cc5314e0f493facd9829a54
Signed-off-by: Bhasker Neti <bneti@codeaurora.org>
Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 22a40f9..449ab3d 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -390,12 +390,17 @@
goto failed;
}
+ hci_dev_unlock_bh(hdev);
+
if (cp->val)
queue_work(hdev->workqueue, &hdev->power_on);
else
queue_work(hdev->workqueue, &hdev->power_off);
err = 0;
+ hci_dev_put(hdev);
+
+ return err;
failed:
hci_dev_unlock_bh(hdev);