[PATCH] Bluetooth: Initialize the SMP workqueue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxxxxxx>

The SMP workqueue is initialized unconditionally because it needs
to be done during module initialization. And during this time we
can't be sure that LE support is available.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxxxxxx>
---
 net/bluetooth/l2cap_core.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 09ca51e..b721f16 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4290,6 +4290,10 @@ int __init l2cap_init(void)
 	if (err < 0)
 		return err;
 
+	err = smp_crypto_init();
+	if (err < 0)
+		BT_DBG("SMP Initialization falied");
+
 	err = hci_register_proto(&l2cap_hci_proto);
 	if (err < 0) {
 		BT_ERR("L2CAP protocol registration failed");
@@ -4307,6 +4311,7 @@ int __init l2cap_init(void)
 	return 0;
 
 error:
+	smp_crypto_exit();
 	l2cap_cleanup_sockets();
 	return err;
 }
@@ -4315,6 +4320,8 @@ void l2cap_exit(void)
 {
 	debugfs_remove(l2cap_debugfs);
 
+	smp_crypto_exit();
+
 	if (hci_unregister_proto(&l2cap_hci_proto) < 0)
 		BT_ERR("L2CAP protocol unregistration failed");
 
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux